Skip to content

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.

Nav

Navigation routines.

methods

  • generate_random_offset() - just a wrapper for returning a random cardinal Direction
  • generate_profitable_offset() - returns the Direction 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() - sets current_assignments information and returns game_map.naive_navigate()'s command for the next move to get to the shipyard
  • less_dumb_move() - returns a command to either move into the Direction specified, or, if the cell is occupied, to stay_still() for a turn in order to avoid collision and avoid burning halite
  • scoot() - returns the next naive_navigate() command in order to continue transit to the destination

StartUp

Ship start up processing/maneuvers.

methods

  • 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 use MapChunk 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

Misc

Whatever.

methods

  • is_position_normalized() returns a boolean (in order to avoid unnecessary normalization taking up processing time) on whether or not the Position 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 in normalize will, indeed, save a small amount of time compared to the conditionals for the vast majority of the turns
Clone this wiki locally