Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GoodStartLabs/AI_Diplomacy
/ functions
Functions
2,689 in github.com/GoodStartLabs/AI_Diplomacy
⨍
Functions
2,689
◇
Types & classes
474
↓ 2 callers
Method
_no_effect
Removes a unit from the combat list of an attack site :param unit: The unit attacking the site (e.g. ['A PAR', []]) :param s
diplomacy/engine/game.py:3915
↓ 2 callers
Function
_norm
(p: str)
ai_diplomacy/utils.py:570
↓ 2 callers
Function
_norm_power
Trim & uppercase for reliable comparisons.
ai_diplomacy/possible_order_context.py:488
↓ 2 callers
Function
_numeric_columns
(df: pd.DataFrame, extra_exclude: set[str] | None = None)
experiment_runner/analysis/statistical_game_analysis.py:65
↓ 2 callers
Function
_numeric_columns
(df: pd.DataFrame)
experiment_runner/analysis/compare_stats.py:77
↓ 2 callers
Method
_parse_negotiation_messages
Parse negotiation messages from raw LLM response.
analysis/statistical_game_analysis.py:933
↓ 2 callers
Function
_plot_phase_level
Plots aggregated phase metrics. If *title_suffix* is supplied it is appended to each chart title — handy for per-run plots.
experiment_runner/analysis/statistical_game_analysis.py:378
↓ 2 callers
Method
_post_remove
(gameID)
diplomacy/web/src/gui/pages/page.jsx:254
↓ 2 callers
Function
_province_type_display
Return 'LAND', 'COAST', or 'WATER' for the 3-letter province code. Falls back to 'UNKNOWN' only if nothing matches.
ai_diplomacy/possible_order_context.py:563
↓ 2 callers
Method
_remove_from_my_games
(gameID)
diplomacy/web/src/gui/pages/page.jsx:305
↓ 2 callers
Method
_save_game_csv
Save game-level features to CSV.
analysis/statistical_game_analysis.py:1259
↓ 2 callers
Method
_save_phase_csv
Save phase-level features to CSV.
analysis/statistical_game_analysis.py:1176
↓ 2 callers
Method
_set_influence
Sets the influence on the map :param xml_map: The xml map being generated :param loc: The province being influenced (e.g. 'P
diplomacy/engine/renderer.py:295
↓ 2 callers
Method
_strengths
This function sets self.combat to a dictionary of dictionaries, specifying each potential destination for every piece, with the strengths
diplomacy/engine/game.py:3650
↓ 2 callers
Function
_sub_hash_password
Hash long password to allow bcrypt to handle password longer than 72 characters. Module private method. :param password: password to
diplomacy/utils/common.py:40
↓ 2 callers
Function
_unit_type
(u: str)
analysis/validation.py:160
↓ 2 callers
Function
_validate_country
(c: str)
analysis/validation.py:104
↓ 2 callers
Function
_validate_place
(code: str, info: ValidationInfo, allow_coast: bool = True)
analysis/validation.py:111
↓ 2 callers
Function
_validate_unit
(u: str, info: ValidationInfo)
analysis/validation.py:125
↓ 2 callers
Function
_welch
(a: np.ndarray, b: np.ndarray, alpha: float)
experiment_runner/analysis/compare_stats.py:168
↓ 2 callers
Function
_write_summary_output
(output_file_path, analysis_data, is_debug_output)
experiments/analyze_rl_json.py:288
↓ 2 callers
Method
addMessage
(message)
diplomacy/web/src/diplomacy/engine/game.js:212
↓ 2 callers
Method
add_admin
Set given username as administrator. Related user must exists in this Users object.
diplomacy/server/users.py:130
↓ 2 callers
Method
add_message
(self, sender: str, recipient: str, content: str)
ai_diplomacy/game_history.py:37
↓ 2 callers
Method
add_new_game
Add a new game data on server in memory and perform any addition processing. This does not save the game on disk. :type serv
diplomacy/server/server.py:659
↓ 2 callers
Method
add_observer_token
Set given token as observer token.
diplomacy/server/server_game.py:332
↓ 2 callers
Method
add_phase
(self, phase_name: str)
ai_diplomacy/game_history.py:86
↓ 2 callers
Function
add_to_cache
Lazy generates convoys paths for a map and adds it to the disk cache :param map_name: The name of the map :param max_convoy_length:
diplomacy/utils/convoy_paths.py:189
↓ 2 callers
Method
add_user
Add a new user with given username and hashed password. See diplomacy.utils.common.hash_password() for hashing purposes.
diplomacy/server/users.py:147
↓ 2 callers
Function
advanceGameManually
( page: Page, maxClicks = 50, trackConversations = false )
ai_animation/tests/e2e/test-helpers.ts:211
↓ 2 callers
Method
analyze_folder
Analyze a single results folder and generate CSV outputs. Args: folder_path: Path to results folder containing l
analysis/statistical_game_analysis.py:103
↓ 2 callers
Method
analyze_multiple_folders
Analyze multiple results folders and combine outputs. Args: parent_folder: Path containing multiple results fold
analysis/statistical_game_analysis.py:187
↓ 2 callers
Method
as_observer_game
Return an observer game data object copy of this game.
diplomacy/server/server_game.py:203
↓ 2 callers
Method
assert_admin_token
Check if given token is an admin token. Raise an exception on error.
diplomacy/server/server.py:864
↓ 2 callers
Function
assert_no_common_keys
Check that dictionaries does not share keys. :param dict1: dict :param dict2: dict
diplomacy/utils/common.py:134
↓ 2 callers
Method
attach_connection_handler
Associate given token with given connection handler if token is known. If there is a previous connection handler associated to given toke
diplomacy/server/users.py:215
↓ 2 callers
Function
buildFancyArrow
(length: number, colorDeter: string)
ai_animation/src/units/animate.ts:18
↓ 2 callers
Function
check_location_influence
Helper - checks who owns a location at a given phase. Uses the `turn_actions` dataframe from overall context. Args:
analysis/p1_make_longform_orders_data.py:158
↓ 2 callers
Method
clearCenters
(parameters, game)
diplomacy/web/src/diplomacy/client/channel.js:183
↓ 2 callers
Method
clearOrderBuildingPath
()
diplomacy/web/src/gui/pages/content_game.jsx:242
↓ 2 callers
Method
clearOrders
(parameters, game)
diplomacy/web/src/diplomacy/client/channel.js:187
↓ 2 callers
Method
clearOrders
(powerName)
diplomacy/web/src/diplomacy/engine/game.js:245
↓ 2 callers
Method
clearUnits
(parameters, game)
diplomacy/web/src/diplomacy/client/channel.js:191
↓ 2 callers
Method
clearUserGameOrders
(username, gameID, powerName)
diplomacy/web/src/gui/utils/dipStorage.jsx:130
↓ 2 callers
Function
closeVictoryModal
()
ai_animation/src/components/victoryModal.ts:48
↓ 2 callers
Method
compact
Compacts a full sentence into a list of short words :param phrase: The full sentence to compact (e.g. 'England: Fleet Western Mediterran
diplomacy/engine/map.py:845
↓ 2 callers
Method
connect
(logger)
diplomacy/web/src/diplomacy/client/connection.js:332
↓ 2 callers
Function
convert_csv_to_rl_json
Converts a CSV file of LLM responses into a JSON format suitable for RL fine-tuning. Args: csv_file_path (str): The absolute path to
experiments/csv_to_rl_json.py:18
↓ 2 callers
Method
count_connections
Return number of registered connection handlers.
diplomacy/server/users.py:110
↓ 2 callers
Method
count_voted
Return the count of controlled powers who already voted for a draw for current phase.
diplomacy/engine/game.py:897
↓ 2 callers
Function
createAnimationsForNextPhase
(phaseIdx: number)
ai_animation/src/units/animate.ts:275
↓ 2 callers
Function
createChatWindow
(power, isGlobal = false)
ai_animation/src/domElements/chatWindows.ts:50
↓ 2 callers
Method
createCheckbox
(id, title, value, onChange)
diplomacy/web/src/gui/components/forms.jsx:74
↓ 2 callers
Function
createDiaryBox
* Creates a diary box for displaying power-specific thoughts and context
ai_animation/src/components/momentModal.ts:309
↓ 2 callers
Function
createMessageElement
* Creates a message element for display
ai_animation/src/components/momentModal.ts:489
↓ 2 callers
Function
createMoveAnimation
(unitMesh: THREE.Group, orderDestination: ProvinceENUM)
ai_animation/src/units/animate.ts:108
↓ 2 callers
Method
createSelectOptions
(values, none)
diplomacy/web/src/gui/components/forms.jsx:107
↓ 2 callers
Function
createUnitMesh
(unitData: UnitData)
ai_animation/src/units/create.ts:125
↓ 2 callers
Method
deleteGame
(parameters, game)
diplomacy/web/src/diplomacy/client/channel.js:217
↓ 2 callers
Method
delete_game
Delete local game instances corresponding to game ID in associated request.
diplomacy/client/response_managers.py:81
↓ 2 callers
Method
delete_game
Delete given game from server (both from memory and disk) and perform any post-deletion processing. :param server_game: game
diplomacy/server/server.py:702
↓ 2 callers
Function
displayFinalPhase
()
ai_animation/src/phase.ts:248
↓ 2 callers
Function
enableInstantMode
(page: Page)
ai_animation/tests/e2e/test-helpers.ts:375
↓ 2 callers
Method
execute_phase
Execute a single communications phase :param game_id: The game id of the current game :param channels: A dictionary of power
diplomacy/daide/tests/test_daide_game.py:219
↓ 2 callers
Function
extract_orders_from_llm_response
Extracts a list of order strings from various formats of llm_response_content. Handles direct lists, JSON strings, and strings with embedded
experiments/analyze_rl_json.py:30
↓ 2 callers
Method
filter_tokens
Remove from this game any token not matching given filter function (if filter_function(token) is False).
diplomacy/server/server_game.py:453
↓ 2 callers
Method
filter_usernames
Remove each omniscient username, moderator username and player controller that does not match given filter function (if filter_function(u
diplomacy/server/server_game.py:421
↓ 2 callers
Function
find_owner_of_unit
Helper - finds the owner of a unit at a given phase. Operating on the `turn_actions` dataframe from overall context. Args:
analysis/p1_make_longform_orders_data.py:212
↓ 2 callers
Function
from_saved_game_format
Rebuilds a :class:`diplomacy.engine.game.Game` object from the saved game (python :class:`Dict`) saved_game is the dictionary. It can be buil
diplomacy/utils/export.py:71
↓ 2 callers
Method
generate_report
Generate a markdown report of key moments
analyze_game_moments.py:923
↓ 2 callers
Function
generate_rich_order_context_xml
Generates a strategic overview context string. Details units and SCs for power_name, including possible orders and simplified adjacencies for
ai_diplomacy/possible_order_context.py:366
↓ 2 callers
Function
generate_token
Generate a token with 2 * n_bytes characters (n_bytes bytes encoded in hexadecimal).
diplomacy/utils/common.py:71
↓ 2 callers
Method
get
(role)
diplomacy/web/src/diplomacy/client/game_instance_set.js:34
↓ 2 callers
Method
getChannel
()
diplomacy/web/src/diplomacy/client/request_future_context.js:35
↓ 2 callers
Method
getController
()
diplomacy/web/src/diplomacy/engine/power.js:46
↓ 2 callers
Function
getCurrentGameId
(page: Page)
ai_animation/tests/e2e/test-helpers.ts:62
↓ 2 callers
Method
getCurrentPowerName
* Get name of current power selected on the game page. * @returns {null|string}
diplomacy/web/src/gui/pages/content_game.jsx:528
↓ 2 callers
Function
getEligibleMoments
* Gets all moments that involve at least 2 powers and have conversations between them * @returns Array of moments eligible for conversation display
ai_animation/src/debug/showRandomMoment.ts:70
↓ 2 callers
Method
getGame
(gameID)
diplomacy/web/src/gui/pages/page.jsx:214
↓ 2 callers
Method
getGames
()
diplomacy/web/src/diplomacy/client/game_instance_set.js:26
↓ 2 callers
Method
getGamesInfo
(parameters)
diplomacy/web/src/diplomacy/client/channel.js:103
↓ 2 callers
Method
getOccupied
(powerName)
diplomacy/web/src/gui/utils/province.js:88
↓ 2 callers
Method
getPhaseType
()
diplomacy/web/src/diplomacy/engine/game.js:415
↓ 2 callers
Method
getRetreated
(powerName)
diplomacy/web/src/gui/utils/province.js:101
↓ 2 callers
Function
getTimeInSeconds
()
ai_animation/src/utils/timing.ts:45
↓ 2 callers
Function
get_absolute_path
Return absolute path of given directory. If given directory is None, return absolute path of current directory.
diplomacy/server/server.py:101
↓ 2 callers
Method
get_connection_handler
Return connection handler associated to given token, or None if no handler currently associated.
diplomacy/server/users.py:126
↓ 2 callers
Method
get_controllers
Return a dictionary mapping each power name to its current controller name.
diplomacy/engine/game.py:604
↓ 2 callers
Method
get_controllers_timestamps
Return a dictionary mapping each power name to its controller timestamp.
diplomacy/engine/game.py:608
↓ 2 callers
Method
get_games
Return a sequence of stored game instances.
diplomacy/client/game_instances_set.py:43
↓ 2 callers
Method
get_ignored_messages_by_power
Identifies which powers are not responding to messages from sender_name. Returns a dict mapping power names to their ignored messages
ai_diplomacy/game_history.py:458
↓ 2 callers
Method
get_map
Return map power names for given map name.
diplomacy/server/server.py:883
↓ 2 callers
Function
get_nearest_enemy_units
Finds up to N nearest enemy units, sorted by path length.
ai_diplomacy/possible_order_context.py:176
↓ 2 callers
Method
get_order_history_for_prompt
( self, game: "Game", power_name: str, current_phase_name: str, num_mo
ai_diplomacy/game_history.py:146
↓ 2 callers
Method
get_orders
1) Builds the prompt with conversation context if available 2) Calls LLM 3) Parses JSON block
ai_diplomacy/clients.py:75
↓ 2 callers
Method
get_power_related_messages
Return expected messages for given power name.
diplomacy/tests/network/test_real_game.py:63
↓ 2 callers
Method
get_related_power_names
Return list of power names controlled by the controlled of given power name.
diplomacy/server/server_game.py:66
↓ 2 callers
Function
get_special_models
Define models for special purposes like phase summaries and formatting. These can be overridden via environment variables: - AI_DIPLOMAC
ai_diplomacy/utils.py:98
↓ 2 callers
Method
get_tokens
Return a sequence of tokens associated to given username.
diplomacy/server/users.py:114
↓ 2 callers
Function
handleClose
()
ai_animation/src/components/momentModal.ts:453
← previous
next →
501–600 of 2,689, ranked by callers