-
Notifications
You must be signed in to change notification settings - Fork 1
history.py
history.py contains the object that we are using instances of in order to save various aspects of the game's state for later processing. At this point, I'm very much considering (instead of just using this object for a single previous turn's information) using a list of these objects in order to be able to access at least myglobals.Const.Initial_Scoot_Distance
turns from the past. Of course, whenever deep learning kicks in, it'll probably be useful to have the entire game's state at each turn available; not sure if that'll be something we can pull in another way via game_map
or something, or if we'll have to use these. Probably a combination of both, actually.
Information on the object contained within follows:
ShipHistory
is simply an object holding the following per-turn values for each ship. The myglobals.Variables.current_assignments
dict holds ShipHistory
objects, each indexed by the ship.id
. This will be changing in the future to allow more than one turn to be saved in the history for better processing and potentially debugging.
-
id
- (yeah, it may be redundant, but we may need it for future revisions) -
location
-Position
on thegame_map
-
destination
-Position
on thegame_map
that we're trying to get to, or are already at -
turnstamp
- the turn at which these parameters were last modified -
primary_mission
- one of themyglobals.Missions.*
enum values; note that the methodology used here may well change very soon -
secondary_mission
- primarily used for flagging when a ship ismyglobals.Missions.in_transit
, as opposed to actually at its destination and carrying out its mission
-
is_initialized()
- returns boolean to signify whether or not this object has been initialized for a ship yet -
is_alive()
- returnsFalse
if the ship has been destroyed, elseTrue
-
__init__()
- does the usual init stuff, requiring all fields to be passed values for initialization -
set_ldps()
- sets ship location, destination, and primary/secondary mission values -
set_loc()
- sets ship location -
set_dest()
- sets ship destination -
prune_current_assignments()
- runs through thecurrent_assignments
list, determining which ships have been destroyed, and then returns the list of thoseid
s to the caller