MCPcopy Create free account

hub / github.com/GoodStartLabs/AI_Diplomacy / functions

Functions2,689 in github.com/GoodStartLabs/AI_Diplomacy

↓ 15 callersMethodget
Return game instance associated to given power name.
diplomacy/client/game_instances_set.py:47
↓ 15 callersMethodgetPage
()
diplomacy/web/src/gui/pages/content_games.jsx:53
↓ 15 callersMethodget_next_value
Get lowest value in sorted set greater than given element, or None if such values does not exists in the sorted set. Given element may no
diplomacy/utils/sorted_set.py:110
↓ 15 callersMethodget_previous_value
Get greatest value in sorted set less the given element, or None if such value does not exists in the sorted set. Given element may not e
diplomacy/utils/sorted_set.py:124
↓ 15 callersMethodis_player_game
Return True if this game is a player game.
diplomacy/engine/game.py:509
↓ 14 callersMethodadd_journal_entry
Adds a formatted entry string to the agent's private journal.
ai_diplomacy/agent.py:355
↓ 14 callersMethodget_units
Retrieves the list of units for a power or for all powers :param power_name: Optional. The name of the power (e.g. ``'FRANCE'``) or None
diplomacy/engine/game.py:920
↓ 14 callersMethodsize
()
diplomacy/web/src/diplomacy/utils/sorted_dict.js:86
↓ 13 callersMethod__init__
Builds the response
diplomacy/daide/notifications.py:376
↓ 13 callersMethod__init__
Constructor
diplomacy/daide/requests.py:150
↓ 13 callersMethod__init__
(self, **kwargs)
diplomacy/communication/notifications.py:138
↓ 13 callersMethod_occupant
Finds the occupant of a site :param site: The site name (e.g. "STP") :param any_coast: Boolean to indicate to return unit on
diplomacy/engine/game.py:3635
↓ 13 callersMethodadd_rule
Adds a rule to the current rule list :param rule: Name of rule to add (e.g. 'NO_PRESS') :return: Nothing
diplomacy/engine/game.py:1358
↓ 13 callersMethodclear_orders
Clears the power's orders :param power_name: Optional. The name of the power to clear (e.g. 'FRANCE') or will clear orders for
diplomacy/engine/game.py:1308
↓ 13 callersMethodget_hash
Returns the zobrist hash for the current game
diplomacy/engine/game.py:1531
↓ 13 callersFunctionget_prompt_path
Get the appropriate prompt path based on USE_UNFORMATTED_PROMPTS setting. Args: prompt_name: Base name of the prompt file (e.g., "convers
ai_diplomacy/utils.py:503
↓ 13 callersMethodvalidate
(self, element)
diplomacy/utils/parsing.py:295
↓ 12 callersMethodclear_centers
Removes ownership of supply centers :param power_name: Optional. The name of the power whose centers will be cleared (e.g. 'FRANCE'),
diplomacy/engine/game.py:1296
↓ 12 callersMethodget_centers
Retrieves the list of owned supply centers for a power or for all powers :param power_name: Optional. The name of the power (e.g. 'FRANC
diplomacy/engine/game.py:942
↓ 12 callersMethodget_order_status
Returns a list or a dict representing the order status ('', 'no convoy', 'bounce', 'void', 'cut', 'dislodged', 'disrupted') for orders su
diplomacy/engine/game.py:1041
↓ 12 callersMethodisEliminated
()
diplomacy/web/src/diplomacy/engine/power.js:50
↓ 12 callersMethodjson
Convert this object to a JSON string ready to be sent/saved. :return: string
diplomacy/utils/jsonable.py:84
↓ 12 callersFunctionnext_time_at
Returns the next timestamp at a specific 'hh:mm' :param timestamp: The unix timestamp to convert :param time_at: The next 'hh:mm' to
diplomacy/utils/time.py:68
↓ 12 callersFunctiontrunc_time
Truncates time at a specific interval (e.g. 20M) (i.e. Rounds to the next :20, :40, :60) :param timestamp: The unix epoch to truncate (e.g.
diplomacy/utils/time.py:49
↓ 12 callersFunctionyScale
(count: number)
ai_animation/src/components/rotatingDisplay.ts:232
↓ 11 callersMethod__init__
(self, key)
diplomacy/utils/exceptions.py:38
↓ 11 callersMethodabut_list
Returns the adjacency list for the site :param site: The province we want the adjacency list for :param incl_no_coast: Boole
diplomacy/engine/map.py:1243
↓ 11 callersMethodclear_cache
Clears all caches
diplomacy/engine/game.py:1324
↓ 11 callersMethodcreateButton
(title, fn, color, large)
diplomacy/web/src/gui/components/forms.jsx:66
↓ 11 callersMethodget
()
diplomacy/web/src/diplomacy/utils/queue.js:41
↓ 11 callersMethodgetValue
(fieldValues, fieldName, defaultValue)
diplomacy/web/src/gui/components/forms.jsx:54
↓ 11 callersMethodload
()
diplomacy/web/src/gui/utils/dipStorage.jsx:35
↓ 11 callersMethodstart
* Start the event queue with current time as reference
ai_animation/src/events.ts:45
↓ 11 callersMethodsuccess
(message)
diplomacy/web/src/gui/pages/page.jsx:185
↓ 10 callersMethod_get_unit_center
Compute coordinates of unit center. :param loc: unit location :param is_dislodged: boolean to tell if unit is dislodged
diplomacy/engine/renderer.py:791
↓ 10 callersMethodclose
()
diplomacy/web/src/diplomacy/client/connection.js:350
↓ 10 callersMethodcount_controlled_powers
Return the number of controlled map powers.
diplomacy/engine/game.py:566
↓ 10 callersMethodfilter_phase_data
Return a filtered version of given phase data for given gam role. :param phase_data: GamePhaseData object to filter. :param
diplomacy/server/server_game.py:76
↓ 10 callersFunctiongetUnitCenter
(coordinates, symbolSizes, loc, isDislodged)
diplomacy/web/src/gui/maps/common/common.js:65
↓ 10 callersFunctionget_unit_at_location
Returns the full unit string (e.g., 'A PAR (FRA)') if a unit is at the location, else None.
ai_diplomacy/possible_order_context.py:118
↓ 10 callersMethodhas
(role)
diplomacy/web/src/diplomacy/client/game_instance_set.js:30
↓ 10 callersMethodnotify_game_addresses
Notify addresses of a game with a notification. Game ID is automatically provided to notification. Token and game role are au
diplomacy/server/notifier.py:348
↓ 10 callersMethodput
(key, value)
diplomacy/web/src/diplomacy/utils/sorted_dict.js:39
↓ 10 callersFunctionrun_llm_and_log
Calls `client.generate_response` with robust retry logic and returns the raw output. This function handles exceptions gracefully: - It r
ai_diplomacy/utils.py:408
↓ 10 callersMethodset_centers
Transfers supply centers ownership :param power_name: The name of the power who will control the supply centers (e.g. 'FRANCE')
diplomacy/engine/game.py:1188
↓ 10 callersMethodset_status
Set game status with given status (should be in diplomacy.utils.strings.ALL_GAME_STATUSES).
diplomacy/engine/game.py:751
↓ 9 callersMethod_get_phase
(self, phase_name: str)
ai_diplomacy/game_history.py:94
↓ 9 callersMethod_notify
Register a notification to send. :param notification: a notification instance. :type notification: notifications._AbstractNo
diplomacy/server/notifier.py:75
↓ 9 callersFunctionassert_equals
Checks that expect == computed.
diplomacy/utils/tests/test_common.py:32
↓ 9 callersFunctionassert_game_not_finished
Check if given game is not yet completed or canceled, otherwise raise a GameFinishedException. :param server_game: server game to check
diplomacy/server/request_manager_utils.py:284
↓ 9 callersMethodbuilder
Return a function to build sorted sets from content (sequence of values). Returned function expects a content parameter like SortedSet in
diplomacy/utils/sorted_set.py:42
↓ 9 callersMethodgenerate_response
( self, prompt: str, temperature: float = 0.0, inject_random_seed: bool = True
ai_diplomacy/clients.py:802
↓ 9 callersMethodgetID
(identifiers)
diplomacy/web/src/gui/utils/province.js:122
↓ 9 callersFunctiongetRequiredElement
* Helper function to get a DOM element by ID and throw an error if not found * @param id The element ID to search for * @returns The HTMLElement *
ai_animation/src/domElements.ts:12
↓ 9 callersMethodhas_token
Return True if users have given token.
diplomacy/server/users.py:86
↓ 9 callersMethodis_controlled
Return True if given power name is currently controlled. :param power_name: power name :type power_name: str :rt
diplomacy/engine/game.py:533
↓ 9 callersMethodis_controlled_by
(for server game) Return True if given power name is controlled by given username.
diplomacy/server/server_game.py:231
↓ 9 callersMethodloadGames
(messages)
diplomacy/web/src/gui/pages/page.jsx:116
↓ 9 callersMethodnorm
Normalise a sentence (add spaces before /, replace -+, with ' ', remove .: :param phrase: Phrase to normalise :return: Norma
diplomacy/engine/map.py:830
↓ 9 callersMethodsave
()
diplomacy/web/src/gui/utils/dipStorage.jsx:53
↓ 9 callersMethodto_type
(self, json_value)
diplomacy/utils/parsing.py:421
↓ 9 callersMethodupdate
(self, element)
diplomacy/utils/parsing.py:217
↓ 9 callersMethodvalidate
(self, element)
diplomacy/utils/parsing.py:214
↓ 8 callersMethod__get_orders
* Return a dictionary of local orders for given game engine. * Returned dictionary maps each power name to either: * - a dictionary of order
diplomacy/web/src/gui/pages/content_game.jsx:546
↓ 8 callersMethod_notify_game
Send a game notification. Game token, game ID and game role will be automatically provided to notification object. :param se
diplomacy/server/notifier.py:89
↓ 8 callersMethodadd_diary_entry
Adds a formatted entry to both the permanent and context diaries.
ai_diplomacy/agent.py:363
↓ 8 callersFunctionassertLength
(expected, given)
diplomacy/web/src/gui/utils/order_building.js:19
↓ 8 callersFunctioncleanProvince
(province: string)
ai_animation/src/types/unitOrders.ts:3
↓ 8 callersMethodcreateRow
(label, input)
diplomacy/web/src/gui/components/forms.jsx:90
↓ 8 callersMethoddone
()
diplomacy/web/src/diplomacy/utils/future.js:52
↓ 8 callersMethoddrop
Drop a place :param place: Name of place to remove :return: Nothing
diplomacy/engine/map.py:767
↓ 8 callersMethodfind_next_phase
Returns the long name of the phase coming immediately after the phase :param phase: The long name of the current phase (e.g. SPRING 1905
diplomacy/engine/map.py:1268
↓ 8 callersFunctiongetClickedID
(event)
diplomacy/web/src/gui/maps/common/common.js:37
↓ 8 callersFunctiongetRequiredTypedElement
* Helper function to get a typed DOM element by ID and throw an error if not found * @param id The element ID to search for * @returns The typed HTM
ai_animation/src/domElements.ts:26
↓ 8 callersFunctionget_type
Return a ParserType sub-class that matches given type. :param desired_type: basic type or ParserType sub-class. :return: ParserType
diplomacy/utils/parsing.py:71
↓ 8 callersMethodhas_token
Return True if game has given token (either observer, omniscient or player).
diplomacy/server/server_game.py:298
↓ 8 callersMethodinfo
(msg)
diplomacy/web/src/diplomacy/utils/diplog.js:27
↓ 8 callersFunctionlog_llm_response_async
Async version of log_llm_response that runs in a thread pool.
ai_diplomacy/utils.py:590
↓ 8 callersMethodmerge
Transfer all units, centers, and homes of the other_power to this power :param other_power: The other power (will be empty after the mer
diplomacy/engine/power.py:239
↓ 8 callersFunctionparseLocation
(txt)
diplomacy/web/src/gui/maps/common/common.js:45
↓ 8 callersFunctionsetInfluence
(classes, mapData, loc, power_name)
diplomacy/web/src/gui/maps/common/common.js:25
↓ 8 callersFunctionshowMomentModal
(options: MomentDialogueOptions)
ai_animation/src/components/momentModal.ts:25
↓ 8 callersMethodto_json
(self, raw_value)
diplomacy/utils/parsing.py:425
↓ 8 callersMethodtoken_is_master
Return True if given token is a master token for given game data. :param token: token :param server_game: game data
diplomacy/server/server.py:803
↓ 8 callersMethodvalidate
(self, element)
diplomacy/utils/parsing.py:505
↓ 7 callersMethod__init__
( self, model_name: str, prompts_dir: Optional[str] = None, base_url: Optional
ai_diplomacy/clients.py:785
↓ 7 callersMethod_is_moving_via_convoy
Determines if a unit is moving via a convoy or through land :param unit: The name of the unit (e.g. 'A PAR') :return: A bool
diplomacy/engine/game.py:1979
↓ 7 callersMethoddefault_coast
Returns the coast for a fleet move order that can only be to a single coast (e.g. F GRE-BUL returns F GRE-BUL/SC) :param wor
diplomacy/engine/map.py:1106
↓ 7 callersMethodfind_coasts
Finds all coasts for a given location :param loc: The name of a location (e.g. 'BUL') :return: Returns the list of all coast
diplomacy/engine/map.py:1126
↓ 7 callersFunctiongenerate_random_seed
(n_lines: int = 5, n_chars_per_line: int = 80)
ai_diplomacy/utils.py:496
↓ 7 callersMethodget_controller
(Network Method) Return current power controller name ('dummy' if power is not controlled).
diplomacy/engine/power.py:376
↓ 7 callersMethodget_expected_controls_count
Return the number of map powers expected to be controlled in this game. This number is either specified in settings or the number of map
diplomacy/engine/game.py:574
↓ 7 callersMethodget_game
Return game saved on server matching given game ID. Raise an exception if game ID not found. Return game if already loaded on
diplomacy/server/server.py:670
↓ 7 callersMethodget_orderable_locations
Find the location requiring an order for a power (or for all powers) :param power_name: Optionally, the name of the power (e.g. 'FRANCE'
diplomacy/engine/game.py:995
↓ 7 callersMethodhas_admin
Return True if given username is an administrator.
diplomacy/server/users.py:82
↓ 7 callersMethodhas_observer_token
Return True if game has given observer token.
diplomacy/server/server_game.py:303
↓ 7 callersMethodhas_omniscient_token
Return True if game has given omniscient observer token.
diplomacy/server/server_game.py:307
↓ 7 callersMethodindexOf
(key)
diplomacy/web/src/diplomacy/utils/sorted_dict.js:74
↓ 7 callersMethodlast_key
Get the highest key from the dict.
diplomacy/utils/sorted_dict.py:126
↓ 7 callersMethodnorm_power
Normalise the name of a power (removes spaces) :param power: Name of power to normalise :return: Normalised power name
diplomacy/engine/map.py:822
← previousnext →101–200 of 2,689, ranked by callers