-
Notifications
You must be signed in to change notification settings - Fork 1
seek_n_nav.py
Damon Getsman edited this page Nov 19, 2018
·
1 revision
seek_n_nav.py contains (go figure) halite seeking and navigation routines. Gonna keep the documentation on this terse right now so that I can get this written and get back to work on the code here. NOTE: I am utterly full of crap on that; I was going to keep it terse and I ended up writing more about each method in this particular file, on average, than I probably did in any of the other files/objects.
Navigation routines.
-
generate_random_offset()
- just a wrapper for returning a random cardinalDirection
-
generate_profitable_offset()
- returns theDirection
of the most halite dense immediate surrounding position; will need to review whether or not it takes potential collisions into account or not -
return_halite_to_shipyard()
- setscurrent_assignments
information and returnsgame_map.naive_navigate()
's command for the next move to get to the shipyard -
less_dumb_move()
- returns a command to either move into theDirection
specified, or, if the cell is occupied, tostay_still()
for a turn in order to avoid collision and avoid burning halite -
scoot()
- returns the nextnaive_navigate()
command in order to continue transit to the destination
Ship start up processing/maneuvers.
-
get_initial_minimum_distance()
- returns ship command for obtaining a minimum amount of distance away from the shipyard before starting on mining (or any other routine), in order to avoid clogging the lanes out of the shipyard. NOTE: this will not be necessary as we useMapChunk
processing to begin searching for local maxima to target selectively; processing can just determine whether or not the local maxima is far enough away for it to be viable, and/or select how many ships are actually going to go on that mission if it is close enough for lane clogging to be an issue
Whatever.
-
is_position_normalized()
returns a boolean (in order to avoid unnecessary normalization taking up processing time) on whether or not thePosition
passed to it is within the technical bounds of the map, or needs to be normalized; not sure how much of a performance increase this will net, I guess I'm not really even sure that it will net any, though I suspect avoiding the modulus operations innormalize
will, indeed, save a small amount of time compared to the conditionals for the vast majority of the turns