yawning_titan.game_modes.game_mode#

Classes

GameMode

All options to configure and represent a complete game mode.

class yawning_titan.game_modes.game_mode.GameMode(doc=None, red=None, blue=None, game_rules=None, observation_space=None, on_reset=None, rewards=None, miscellaneous=None, _doc_metadata=None)[source]#

All options to configure and represent a complete game mode.

The ConfigGroup constructor.

Parameters:

doc – The groups doc.

__init__(doc=None, red=None, blue=None, game_rules=None, observation_space=None, on_reset=None, rewards=None, miscellaneous=None, _doc_metadata=None)[source]#

The ConfigGroup constructor.

Parameters:

doc – The groups doc.

classmethod create_from_yaml(yaml=None, legacy=False, infer_legacy=True)[source]#

Generate a formatted instance of :class: GameMode from stored data.

Parameters:
  • yaml – A yaml dictionary in the format generated by the to_yaml method.

  • legacy – Whether the dictionary will be in legacy format.

  • infer_legacy – Whether to try to set the legacy parameter based upon the keys in the dictionary.

Returns:

An instance of :class: GameMode.

classmethod create(dict=None, legacy=False, infer_legacy=True, raise_errors=False)[source]#

Generate a formatted instance of :class: GameMode from stored data.

Parameters:
  • dict – A nested dictionary in the format generated by the to_dict method.

  • legacy – Whether the dictionary will be in legacy format.

  • infer_legacy – Whether to try to set the legacy parameter based upon the keys in the dictionary.

Returns:

An instance of :class: GameMode.

to_dict(json_serializable=False, include_none=True, values_only=False)[source]#

Serialize the Network as a dict.

Parameters:
  • json_serializable – If True, the Network “d numpy array is converted to a list.”

  • include_none – Determines whether to include empty fields in the dict. Has a default value of True.

Returns:

The Network as a dict.