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
↓ 1 callers
Function
_addUnitsToBoard
(phaseIndex: number)
ai_animation/src/units/create.ts:156
↓ 1 callers
Method
_add_adjust_orders
Adds an adjustment order (Adjustment Phase) :param power: The power instance who is submitting orders (or None if power is in the orders
diplomacy/engine/game.py:3387
↓ 1 callers
Method
_add_coasts
This method adds the matching coast to orders supporting or (portage) convoying a fleet to a multi-coast province. :return:
diplomacy/engine/game.py:2598
↓ 1 callers
Method
_add_retreat_orders
Adds a retreat order (Retreats Phase) :param power: The power instance who is submitting orders (or None if power is in the orders)
diplomacy/engine/game.py:3270
↓ 1 callers
Method
_add_to_my_games
(game)
diplomacy/web/src/gui/pages/page.jsx:296
↓ 1 callers
Function
_adjacent_territory_lines
( graph, game_map, board_state, unit_loc_full: str, mover_descr: str, our_power: str,
ai_diplomacy/possible_order_context.py:607
↓ 1 callers
Method
_advance_phase
Advance the game to the next phase (skipping phases with no actions) :return: A list of lines to put in the results
diplomacy/engine/game.py:2825
↓ 1 callers
Method
_aggregate_order_results
Sum every order-type/result pair over *all* phases for one power and add success-rate (0-1) columns.
analysis/statistical_game_analysis.py:313
↓ 1 callers
Method
_analyze_failures
Analyze failure patterns for specific power/phase/response_type.
analysis/statistical_game_analysis.py:1343
↓ 1 callers
Method
_backup_games_now
Save latest backed-up versions of loaded games on disk. :param force: if True, force to save all games currently loaded in memory
diplomacy/server/server.py:370
↓ 1 callers
Method
_backup_server_data_now
Save latest backed-up version of server data on disk. This does not save games. :param force: if True, force to save current server data
diplomacy/server/server.py:357
↓ 1 callers
Function
_bayesian_t_test
Perform a simple Bayesian t-test assuming uninformative priors.
experiment_runner/analysis/compare_stats.py:139
↓ 1 callers
Method
_begin
Called to begin the game and move to the start phase :return: Nothing
diplomacy/engine/game.py:2781
↓ 1 callers
Method
_bounce
This methods marks all units that can't get where they're going as bounced. It loops to handle bounce-chains.
diplomacy/engine/game.py:3800
↓ 1 callers
Method
_build_adjacencies_clause
Build the adjacencies clause Syntax: :: (adjacencies) adjacencies syntax: :: (prov_adjace
diplomacy/daide/responses.py:257
↓ 1 callers
Function
_build_cmd
Returns a list suitable for subprocess.run([...]).
experiment_runner.py:375
↓ 1 callers
Function
_build_convoy_paths_cache
Builds the convoy paths cache for a map :param map_object: The instantiated map object :param max_convoy_length: The maximum convoy
diplomacy/utils/convoy_paths.py:138
↓ 1 callers
Method
_build_from_dict
Builds this object from a dictionary :type order: dict
diplomacy/integration/webdiplomacy_net/orders.py:449
↓ 1 callers
Method
_build_from_string
Builds this object from a string :type order: str :type game: diplomacy.Game
diplomacy/integration/webdiplomacy_net/orders.py:166
↓ 1 callers
Function
_build_full_parser
()
experiment_runner.py:236
↓ 1 callers
Method
_build_hash_table
Builds the Zobrist hash tables
diplomacy/engine/game.py:2749
↓ 1 callers
Method
_build_powers_clause
Build the powers clause Syntax: :: (powers) powers syntax: :: power power ...
diplomacy/daide/responses.py:142
↓ 1 callers
Method
_build_provinces_clause
Build the provinces clause Syntax: :: (provinces) provinces syntax: :: (supply_centres) (
diplomacy/daide/responses.py:172
↓ 1 callers
Method
_build_sites
(power)
diplomacy/web/src/diplomacy/engine/game.js:517
↓ 1 callers
Method
_calculate_averaged_game_metrics
Calculate both totals and averaged behavioral metrics across the entire game.
analysis/statistical_game_analysis.py:742
↓ 1 callers
Method
_calculate_sentiment_metrics
Calculate sentiment metrics for a power.
analysis/statistical_game_analysis.py:1006
↓ 1 callers
Function
_call_model_async
Return a 2–4 sentence spectator-friendly narrative using async client.
ai_diplomacy/narrative.py:41
↓ 1 callers
Function
_call_openai
Return a 2–4 sentence spectator-friendly narrative.
ai_diplomacy/narrative.py:73
↓ 1 callers
Method
_capture_centers
In Adjustment Phase, proceed with the capture of occupied supply centers :return: Nothing
diplomacy/engine/game.py:3045
↓ 1 callers
Method
_check_phase
Checks if we need to process a phase, or if we can skip it if there are no actions :return: Boolean (0 or 1) - 0 if we need to process p
diplomacy/engine/game.py:2897
↓ 1 callers
Method
_compute_game_scores
Return {power → game_score} using the revised Diplobench scheme. Rules ----- max_year : taken from overview.jsonl
analysis/statistical_game_analysis.py:1075
↓ 1 callers
Method
_default_orders
Issues default orders for a power (HOLD) :param power: The power instance :return: Nothing
diplomacy/engine/game.py:3576
↓ 1 callers
Function
_default_phase_summary_callback
Generate a default statistical summary callback when none is provided.
ai_diplomacy/narrative.py:90
↓ 1 callers
Function
_dest_occupancy_desc
(occupied by X)', '(occupied by X — you!)', or '(unoccupied)
ai_diplomacy/possible_order_context.py:582
↓ 1 callers
Function
_detect_victory
True iff any power already owns ≥ `threshold` supply centres.
lm_game.py:57
↓ 1 callers
Method
_determine_orders
Builds the self.orders dictionary (i.e. makes sure all orders are legitimate).
diplomacy/engine/game.py:3557
↓ 1 callers
Method
_determine_win
Determine if we have a win. :param last_year: A dict containing the score for each power (e.g. {'FRANCE': 10, 'ENGLAND': 2})
diplomacy/engine/game.py:3012
↓ 1 callers
Function
_dump_seed
(seed: int, run_dir: Path)
experiment_runner.py:369
↓ 1 callers
Method
_expand_coast
Makes sure the correct coast is specified (if any) is specified. For Fleets: Adjust to correct coast if wrong coast is specified
diplomacy/engine/game.py:2511
↓ 1 callers
Function
_extract_diplomacy_results
(game_json: Path)
experiment_runner/analysis/summary.py:24
↓ 1 callers
Method
_extract_game_features
Extract game-level features (placeholder for future implementation).
analysis/statistical_game_analysis.py:646
↓ 1 callers
Method
_extract_game_state_features
Extract game state metrics for a power in a phase.
analysis/statistical_game_analysis.py:605
↓ 1 callers
Method
_extract_json_from_text
Extract and parse JSON from text, handling common LLM response formats.
ai_diplomacy/agent.py:107
↓ 1 callers
Method
_extract_moves
Attempt multiple parse strategies to find JSON array of moves. 1. Regex for PARSABLE OUTPUT lines. 2. If that fails, also lo
ai_diplomacy/clients.py:197
↓ 1 callers
Method
_extract_negotiation_features
Extract negotiation-related metrics for a power in a phase.
analysis/statistical_game_analysis.py:448
↓ 1 callers
Method
_extract_order_results_features
Count orders and outcomes for a single power in one phase and add a success-rate (0-1) for every order type.
analysis/statistical_game_analysis.py:265
↓ 1 callers
Method
_extract_phase_features
Extract phase-level features for all powers, phases, and response types.
analysis/statistical_game_analysis.py:362
↓ 1 callers
Method
_extract_power_phase_response_features
Extract features for a specific power/phase/response_type combination.
analysis/statistical_game_analysis.py:389
↓ 1 callers
Method
_extract_reflection_features
Extract reflection-related metrics for a power in a phase.
analysis/statistical_game_analysis.py:543
↓ 1 callers
Method
_find_next_phase
Returns the long name of the phase coming immediately after the current phase :param phase_type: The type of phase we are looking for
diplomacy/engine/game.py:2869
↓ 1 callers
Function
_generate_condensed_move_summary
Compact, human-readable list of every legal order for *our* units, grouping each friendly support beneath the move / hold it aids. Examp
ai_diplomacy/possible_order_context.py:836
↓ 1 callers
Method
_generate_phase_summary
A comprehensive private method to generate a summary for the specified `phase_key` (e.g. "S1901M"), including a comparison with the p
diplomacy/engine/game.py:4554
↓ 1 callers
Function
_generate_rich_order_context_adjustment
* First line states how many builds are allowed or disbands required. * Echo every B/D order exactly as supplied, skipping WAIVE. * No wr
ai_diplomacy/possible_order_context.py:798
↓ 1 callers
Function
_generate_rich_order_context_retreat
Flatten all retreat / disband orders into one list: A PAR R PIC A PAR D F NTH R HEL If the engine supplies nothing, r
ai_diplomacy/possible_order_context.py:773
↓ 1 callers
Method
_get_convoy_paths
Return a list of all possible convoy paths (using convoying units) from start to end :param unit_type: The unit type BEING convoyed (e.g
diplomacy/engine/game.py:2067
↓ 1 callers
Method
_get_convoying_units_for_path
Returns a list of units who have submitted orders to convoy 'unit' from 'start' to 'end' :param unit: The unit BEING convoyed (e.g. 'A'
diplomacy/engine/game.py:2011
↓ 1 callers
Method
_get_distance_to_home
Calculate the distance from unit to one of its homes Armies can move over water (4.D.8 choice d) :param unit_type: The unit
diplomacy/engine/game.py:2115
↓ 1 callers
Function
_get_game_to_notify
Get notified game from connection using notification parameters. :param connection: connection that receives the notification. :para
diplomacy/client/notification_managers.py:28
↓ 1 callers
Function
_get_power_enum
()
analysis/statistical_game_analysis.py:36
↓ 1 callers
Method
_get_session
Get or create the aiohttp session for connection pooling.
ai_diplomacy/clients.py:1066
↓ 1 callers
Method
_handle_unknown_token
Notify server about an unknown channel token. This is likely because the channel has gone out of scope. :param token: token t
diplomacy/client/connection.py:276
↓ 1 callers
Method
_intersection_with_ab
Return coordinates of intersection of line (OM) with line (AB). :param x_m: x coordinate of M :param y_m: y coordinate of M
diplomacy/utils/equilateral_triangle.py:66
↓ 1 callers
Method
_intersection_with_ac
Return coordinates of intersection of line (OM) with line (AC). :param x_m: x coordinate of M :param y_m: y coordinate of M
diplomacy/utils/equilateral_triangle.py:90
↓ 1 callers
Method
_intersection_with_bc
Return coordinates of intersection of line (OM) with line (BC). NB: (BC) is an horizontal line. :param x_m: x coordinate of
diplomacy/utils/equilateral_triangle.py:112
↓ 1 callers
Method
_is_convoyer
Detects if there is a convoyer at thru location for army/fleet (e.g. can an army be convoyed through PAR) :param army: Boolean to indica
diplomacy/engine/game.py:1960
↓ 1 callers
Method
_issue_build_order
Adds a build army/fleet order to the map :param xml_map: The xml map being generated :param unit_type: The unit type to buil
diplomacy/engine/renderer.py:698
↓ 1 callers
Method
_issue_convoy_order
Issues a convoy order :param xml_map: The xml map being generated :param loc: The location of the unit convoying (e.g. 'BER'
diplomacy/engine/renderer.py:591
↓ 1 callers
Method
_issue_disband_order
Adds a disband order to the map :param xml_map: The xml map being generated :param loc: The province where the unit is disba
diplomacy/engine/renderer.py:744
↓ 1 callers
Method
_issue_hold_order
Adds a hold order to the map :param xml_map: The xml map being generated :param loc: The province where the unit is holding
diplomacy/engine/renderer.py:374
↓ 1 callers
Method
_issue_support_hold_order
Issues a support hold order :param xml_map: The xml map being generated :param loc: The location of the unit sending support
diplomacy/engine/renderer.py:408
↓ 1 callers
Method
_issue_support_move_order
Issues a support move order :param xml_map: The xml map being generated :param loc: The location of the unit sending support
diplomacy/engine/renderer.py:531
↓ 1 callers
Method
_load
Load database from disk.
diplomacy/server/server.py:321
↓ 1 callers
Function
_load_analysis_fns
Dynamically import analysis modules. Each module must expose `run(experiment_dir: Path, cfg: dict)`.
experiment_runner.py:448
↓ 1 callers
Method
_load_available_maps
Load a dictionary (self.available_maps) mapping every map name to a dict of map info. for all maps available in diplomacy package.
diplomacy/server/server.py:291
↓ 1 callers
Method
_load_from_bytes
Creates a token from its bytes representation
diplomacy/daide/tokens.py:93
↓ 1 callers
Method
_load_from_int
Creates a token from an integer representation
diplomacy/daide/tokens.py:72
↓ 1 callers
Method
_load_from_str
Creates a token from a DAIDE string representation
diplomacy/daide/tokens.py:57
↓ 1 callers
Method
_load_llm_responses
Load and validate LLM responses CSV.
analysis/statistical_game_analysis.py:247
↓ 1 callers
Method
_load_metadata
Loads meta-data embedded in the XML map and clears unused nodes
diplomacy/engine/renderer.py:197
↓ 1 callers
Method
_load_rules
Loads the list of rules and their forced (+) and denied (!) corresponding rules :return: A tuple of dictionaries: rules, forced, and den
diplomacy/engine/game.py:2695
↓ 1 callers
Function
_make_game_ids_unique
Ensures every lmvsgame.json in *run_dirs* carries a distinct `"id"`. If a duplicate is found we overwrite it with a fresh 16-char UUID **
experiment_runner.py:339
↓ 1 callers
Function
_map_game_id_to_run_dir
Reads each runs/run_xxxxx/lmvsgame.json file and returns {game_id_string: 'run_xxxxx'}.
experiment_runner/analysis/statistical_game_analysis.py:116
↓ 1 callers
Function
_mk_run_dir
(exp_dir: Path, idx: int)
experiment_runner.py:332
↓ 1 callers
Method
_move_results
Resolves moves (Movement phase) and returns a list of messages explaining what happened :return: A list of lines for the results file ex
diplomacy/engine/game.py:4223
↓ 1 callers
Method
_norm_order
Normalizes the order format and split it into tokens This is only used for **movement** orders (to make sure NO_CHECK games used the corr
diplomacy/engine/renderer.py:248
↓ 1 callers
Method
_on_socket_message
Manage given socket_message (string), that may be a string representation of either a request or a notification.
diplomacy/client/connection.py:213
↓ 1 callers
Function
_order_kind
(order: str)
analysis/validation.py:136
↓ 1 callers
Method
_other_results
Resolves moves (Retreat and Adjustment phase) and returns a list of messages explaining what happened :return: A list of lines for the r
diplomacy/engine/game.py:4306
↓ 1 callers
Function
_parse_cli
()
experiment_runner.py:256
↓ 1 callers
Function
_parse_model_spec
Splits once on '#' (API key) and once on '@' (base URL). A leading '<prefix>:' is optional. Nothing else is interpreted.
ai_diplomacy/clients.py:1404
↓ 1 callers
Function
_perform_analysis
(json_directory)
experiments/analyze_rl_json.py:161
↓ 1 callers
Function
_phase_by_name
(phases: List[dict], name: str)
experiment_runner/analysis/critical_state.py:20
↓ 1 callers
Function
_phase_index
(series: pd.Series)
experiment_runner/analysis/statistical_game_analysis.py:111
↓ 1 callers
Function
_phase_index
(ph_series: pd.Series)
experiment_runner/analysis/compare_stats.py:278
↓ 1 callers
Method
_plain_stroke_width
Return generic stroke width for plain lines. :return: stroke width as floating value.
diplomacy/engine/renderer.py:805
↓ 1 callers
Function
_plot_game_level
• Box-plots per metric (hue = power, legend removed). • Z-score heat-map: powers × metrics, colour-coded by relative standing.
experiment_runner/analysis/statistical_game_analysis.py:139
↓ 1 callers
Function
_plot_phase_level_per_game
Writes one folder of phase-plots per iteration. Folder name and chart titles use the run directory (e.g. run_00003).
experiment_runner/analysis/statistical_game_analysis.py:435
↓ 1 callers
Function
_plot_phase_overlay
(exp_a: Path, exp_b: Path, out_dir: Path)
experiment_runner/analysis/compare_stats.py:288
↓ 1 callers
Function
_plot_relationships_per_game
For each game, create one PNG per *focal* power that shows • self-perceived relationship to every other power (solid, full colour)
experiment_runner/analysis/statistical_game_analysis.py:190
↓ 1 callers
Method
_post_move_update
Deletes orders and removes CD flag after moves
diplomacy/engine/game.py:2956
← previous
next →
701–800 of 2,689, ranked by callers