MCPcopy Create free account

hub / github.com/GoodStartLabs/AI_Diplomacy / functions

Functions2,689 in github.com/GoodStartLabs/AI_Diplomacy

↓ 7 callersFunctionorder_dict_to_str
Converts an order from the dictionary format to the string format :param order_dict: The order in dictionary format from webdiplomacy.net
diplomacy/integration/webdiplomacy_net/game.py:133
↓ 7 callersMethodremove_tokens
(Server Method) Remove sequence of tokens from this power.
diplomacy/engine/power.py:403
↓ 7 callersFunctionrun_with_timeout
Raises an error on timeout
diplomacy/daide/tests/test_daide_game.py:50
↓ 7 callersMethodsave_data
Update on-memory backup of server data.
diplomacy/server/server.py:534
↓ 7 callersMethodschedule
* Add an event to the queue
ai_animation/src/events.ts:75
↓ 7 callersMethodset_controlled
Control power with given username (may be None to set dummy power). See method diplomacy.Power#set_controlled.
diplomacy/engine/game.py:804
↓ 7 callersMethodsmallest
Finds the smallest item in the priority dict :return: A tuple of (priority, key) for the item with the smallest priority, or None if dic
diplomacy/utils/priority_dict.py:77
↓ 7 callersFunctionturn_to_phase
Converts a turn and phase to a short phase name e.g. turn 1 - phase 'Retreats' to 'F1901R'
diplomacy/integration/webdiplomacy_net/game.py:20
↓ 7 callersMethodvalidate
(self, element)
diplomacy/utils/parsing.py:525
↓ 6 callersMethod__init__
Constructor
diplomacy/daide/clauses.py:435
↓ 6 callersMethod__store_orders
* Save given orders into local storage. * @param orders - orders to save * @private
diplomacy/web/src/gui/pages/content_game.jsx:572
↓ 6 callersMethod_build_sites
Returns a list of sites where power can build units :param power: The power instance to check :return: A list of build sites
diplomacy/engine/game.py:2961
↓ 6 callersMethodaddDebugTool
* Adds a new debug tool section to the menu * @param title - The title of the debug section * @param content - HTML content for the debug tool
ai_animation/src/debug/debugMenu.ts:114
↓ 6 callersMethodadd_token
(Server Method) Add given token to this power.
diplomacy/engine/power.py:398
↓ 6 callersFunctionbytes_to_str
Converts a bytes into its str representation :param daide_bytes: A DAIDE bytes with tokens separated by spaces :return: The bytes re
diplomacy/daide/utils.py:59
↓ 6 callersMethoderror
(msg)
diplomacy/web/src/diplomacy/utils/diplog.js:19
↓ 6 callersFunctionextendOrderBuilding
(powerName, orderType, currentOrderPath, location, onBuilding, onBuilt, onError)
diplomacy/web/src/gui/utils/order_building.js:197
↓ 6 callersMethodfind_previous_phase
Returns the long name of the phase coming immediately prior the phase :param phase: The long name of the current phase (e.g. SPRING 1905
diplomacy/engine/map.py:1317
↓ 6 callersMethodformat_private_diary_for_prompt
Formats the context diary for inclusion in a prompt. It separates the single consolidated history entry from all recent full entries.
ai_diplomacy/agent.py:418
↓ 6 callersFunctionformat_with_gemini_flash
Format a natural language response into required JSON structure using Gemini Flash. Args: raw_response: Natural language response fr
ai_diplomacy/formatter.py:27
↓ 6 callersMethodgetControllablePowers
()
diplomacy/web/src/diplomacy/engine/game.js:421
↓ 6 callersMethodget_all_possible_orders
Computes a list of all possible orders for all locations :return: A dictionary with locations as keys, and their respective list of poss
diplomacy/engine/game.py:1729
↓ 6 callersMethodget_controlled_power_names
Return the list of power names currently controlled by given user name.
diplomacy/engine/game.py:570
↓ 6 callersMethodget_map_power_names
Return sequence of map power names.
diplomacy/engine/game.py:912
↓ 6 callersMethodis_global
Return True if this message is global.
diplomacy/engine/message.py:115
↓ 6 callersMethodis_moderator
Return True if given username is a moderator of this game.
diplomacy/server/server_game.py:395
↓ 6 callersMethodis_omniscient_game
Return True if this game is an omniscient game.
diplomacy/engine/game.py:517
↓ 6 callersMethodremove
Pop (remove and return) value associated with given key, or None if key not found.
diplomacy/utils/sorted_dict.py:112
↓ 6 callersMethodremove
(key)
diplomacy/web/src/diplomacy/utils/sorted_dict.js:53
↓ 6 callersFunctionrun_game_data
Start a server and a client to test DAIDE communications :param port: The port of the DAIDE server :param csv_file: the csv file con
diplomacy/daide/tests/test_daide_game.py:358
↓ 6 callersMethodsetException
(exception)
diplomacy/web/src/diplomacy/utils/future.js:44
↓ 6 callersMethodset_phase_data
Set game from phase data. :param phase_data: either a GamePhaseData or a list of GamePhaseData. If phase_data is a GameP
diplomacy/engine/game.py:1592
↓ 6 callersMethodset_wait
Set wait flag for a power. :param power_name: name of power to set wait flag. :param wait: wait flag (boolean).
diplomacy/engine/game.py:1268
↓ 6 callersFunctionshowFeedback
* Shows feedback message to the user
ai_animation/src/debug/phaseJump.ts:181
↓ 6 callersMethodstart
Start server if not yet started. Raise an exception if server is already started. :param port: (optional) port where server must run. If
diplomacy/server/server.py:478
↓ 6 callersMethodstop
Stop the server and close all connections
diplomacy/daide/server.py:50
↓ 6 callersMethodunschedule_game
Remove a game from scheduler. :param server_game: game :type server_game: ServerGame
diplomacy/server/server.py:736
↓ 6 callersMethodvalidate
(self, element)
diplomacy/utils/parsing.py:480
↓ 5 callersMethod__init__
Constructor
diplomacy/daide/messages.py:55
↓ 5 callersMethod__init__
(self, **kwargs)
diplomacy/communication/responses.py:54
↓ 5 callersMethod_center_symbol_around_unit
Compute top-left coordinates of a symbol to be centered around a unit. :param loc: unit location (e.g. 'PAR') :param is_disl
diplomacy/engine/renderer.py:774
↓ 5 callersMethod_expand_order
Detects errors in order, convert to short version, and expand the default coast if necessary :param word: The words (e.g. order.split())
diplomacy/engine/game.py:2424
↓ 5 callersMethod_get_relationships_for_phase
Get relationships for a power in a specific phase.
analysis/statistical_game_analysis.py:968
↓ 5 callersMethod_has_convoy_path
Determines if there is a convoy path for unit :param unit: The unit BEING convoyed (e.g. 'A' or 'F') :param start: The start
diplomacy/engine/game.py:1994
↓ 5 callersMethod_notify_power
Send a notification to all tokens of a power. Automatically add token, game ID and game role to notification parameters. :pa
diplomacy/server/notifier.py:105
↓ 5 callersFunction_setPhase
(phaseIndex: number)
ai_animation/src/phase.ts:20
↓ 5 callersMethodadd_homes
Add new homes (and deletes previous homes if reinit) :param power: Name of power (e.g. ITALY) :param homes: List of homes e.
diplomacy/engine/map.py:729
↓ 5 callersMethodas_power_game
Return a player game data object copy of this game for given power name.
diplomacy/server/server_game.py:167
↓ 5 callersFunctioncallback
()
ai_animation/src/domElements.ts:41
↓ 5 callersFunctioncenterSymbolAroundUnit
(coordinates, symbolSizes, loc, isDislodged, symbol)
diplomacy/web/src/gui/maps/common/common.js:51
↓ 5 callersMethodcreateOnChangeCallback
(component, callback)
diplomacy/web/src/gui/components/forms.jsx:22
↓ 5 callersFunctionensure_path
Make sure given folder path exists and return given path. Raises an exception if path does not exists, cannot be created or is not a folder.
diplomacy/server/server.py:140
↓ 5 callersMethodfallback_orders
Just picks HOLD if possible, else first option.
ai_diplomacy/clients.py:391
↓ 5 callersMethodfilter_messages
Filter given messages based on given game role between given timestamps (bounds included). See method diplomacy.utils.SortedDict.sub() ab
diplomacy/engine/game.py:637
↓ 5 callersMethodgetPower
(name)
diplomacy/web/src/diplomacy/engine/game.js:284
↓ 5 callersFunctiongetPowerHexColor
(power: PowerENUM | undefined)
ai_animation/src/units/create.ts:9
↓ 5 callersFunctiongetProvincePosition
(loc: string)
ai_animation/src/map/utils.ts:3
↓ 5 callersFunctionget_country_to_model_mapping
Get a country:model map of which country was played by which model, different in different versions of data
analysis/analysis_helpers.py:70
↓ 5 callersMethodget_daide_port
Get the DAIDE port opened for a specific game_id :param game_id: game id of the DAIDE server.
diplomacy/server/server.py:922
↓ 5 callersFunctionget_nearest_uncontrolled_scs
Return up to N nearest supply centres not controlled by `power_name`, including the unit’s own province if applicable (distance 0 means h
ai_diplomacy/possible_order_context.py:224
↓ 5 callersMethodget_observer_level
Return the highest observation level allowed for given username. :param username: name of user to get observation right :ret
diplomacy/server/server_game.py:235
↓ 5 callersMethodget_omniscient_addresses
Generate addresses (couples [power name, token]) of omniscient observers of this game.
diplomacy/server/server_game.py:272
↓ 5 callersMethodget_phase_history
Return a list of game phase data from game history between given phases (bounds included). Each GamePhaseData object contains game state,
diplomacy/engine/game.py:671
↓ 5 callersFunctionget_sc_controller
Returns the controlling power's name if the location is an SC, else None.
ai_diplomacy/possible_order_context.py:130
↓ 5 callersMethodis_omniscient
Return True if given username is allowed to be an omniscient observer of this game.
diplomacy/server/server_game.py:399
↓ 5 callersMethodload
(name, body, messages)
diplomacy/web/src/gui/pages/page.jsx:104
↓ 5 callersFunctionload_model_client
Recognises strings like gpt-4o anthropic:claude-3.7-sonnet openai:llama-3-2-3b@https://localhost:8000#myapikey gp
ai_diplomacy/clients.py:1432
↓ 5 callersMethodnetworkGameIsDisplayed
* Return True if given network game is the game currently displayed on the interface. * @param {NetworkGame} networkGame - network game to check
diplomacy/web/src/gui/pages/content_game.jsx:348
↓ 5 callersMethodnotify_game_powers_controllers
Notify all game tokens about current game powers controllers. :param server_game: game to notify :type server_game: diplomac
diplomacy/server/notifier.py:175
↓ 5 callersMethodpause
(parameters, game)
diplomacy/web/src/diplomacy/client/channel.js:241
↓ 5 callersMethodpromise
()
diplomacy/web/src/diplomacy/utils/future.js:32
↓ 5 callersMethodsetPhaseData
(phaseData)
diplomacy/web/src/diplomacy/engine/game.js:316
↓ 5 callersMethodset_current_phase
Changes the phase to the specified new phase (e.g. 'S1901M')
diplomacy/engine/game.py:1329
↓ 5 callersMethodstop_game_if_needed
Stop game if it has not required number of controlled powers. Notify game if status changed. :param server_game: game to che
diplomacy/server/server.py:765
↓ 5 callersFunctionupdateMapOwnership
()
ai_animation/src/map/state.ts:52
↓ 5 callersMethodwait
(parameters, game)
diplomacy/web/src/diplomacy/client/channel.js:195
↓ 5 callersMethodwrapMessage
(message)
diplomacy/web/src/gui/pages/page.jsx:62
↓ 4 callersMethod__change_past_phase
(newPhaseIndex)
diplomacy/web/src/gui/pages/content_game.jsx:797
↓ 4 callersMethod__init__
(self, **kwargs)
diplomacy/utils/tests/test_jsonable_changes.py:41
↓ 4 callersMethod_add_unit_types
Adds any missing "A" and "F" designations and (current) coastal locations for fleets. :param item: The words for expand_order() (e.g. ['
diplomacy/engine/game.py:2558
↓ 4 callersMethod_boing
Mark a unit bounced, and update the combat table to show the unit as having strength one at its current location :param unit
diplomacy/engine/game.py:3786
↓ 4 callersMethod_build_list_possible_convoys
Regenerates the list of possible convoy paths given the current fleet locations
diplomacy/engine/game.py:1932
↓ 4 callersMethod_colored_stroke_width
Return generic stroke width for colored or textured lines. :return: stroke width as floating value.
diplomacy/engine/renderer.py:812
↓ 4 callersMethod_get_convoy_destinations
Returns a list of possible convoy destinations for a unit :param unit: The unit BEING convoyed (e.g. 'A' or 'F') :param star
diplomacy/engine/game.py:2027
↓ 4 callersFunction_print_hdr
(title: str)
experiment_runner/analysis/compare_stats.py:255
↓ 4 callersMethod_resolve_unclear
Check if given aliases string is an unclear power name. If that's the case, return other name associated to this alias. Other
diplomacy/engine/map.py:932
↓ 4 callersFunction_sanitize
(name: str)
experiment_runner/analysis/statistical_game_analysis.py:57
↓ 4 callersFunction_significant
(df: pd.DataFrame, alpha: float)
experiment_runner/analysis/compare_stats.py:260
↓ 4 callersFunction_year
(name: str)
experiment_runner/analysis/summary.py:72
↓ 4 callersMethodadd
(game)
diplomacy/web/src/diplomacy/client/game_instance_set.js:62
↓ 4 callersMethodadd_message
Add message to current game data. Only a server game can add a message with no timestamp: game will auto-generate a timestamp
diplomacy/engine/game.py:856
↓ 4 callersMethodany
(province, unusedPowerName)
diplomacy/web/src/gui/utils/order_building.js:62
↓ 4 callersMethodauthenticate
Send a :class:`.SignIn` request. User will be created on the server automatically if it doesn't exist. :param username: user
diplomacy/client/connection.py:133
↓ 4 callersFunctionbuild_context_prompt
Builds the detailed context part of the prompt. Args: game: The game object. board_state: Current state of the board. pow
ai_diplomacy/prompt_constructor.py:34
↓ 4 callersFunctioncenter_dict_to_str
Converts a supply center from the dictionary format to the string format e.g. ``{'terrID': 6, 'countryId': 1}`` to ``'ENGLAND', 'LON'``
diplomacy/integration/webdiplomacy_net/game.py:84
↓ 4 callersFunctioncheckForVictoryMessage
(page: Page)
ai_animation/tests/e2e/test-helpers.ts:42
↓ 4 callersMethodclear_vote
Clear current vote.
diplomacy/engine/game.py:903
↓ 4 callersFunctioncloseMomentModal
(immediate: boolean = false)
ai_animation/src/components/momentModal.ts:183
↓ 4 callersMethodcollapse
* Collapses the debug panel
ai_animation/src/debug/debugMenu.ts:101
↓ 4 callersFunctioncoloredStrokeWidth
(symbolSizes)
diplomacy/web/src/gui/maps/common/common.js:81
← previousnext →201–300 of 2,689, ranked by callers