INNER CODE UNIT · Python
path_len
ikatsov/tensor-house · supply-chain/world_of_supply/world_of_supply_environment.py:90
def path_len(self):
if self.path == None:
return 0
else:
return len(self.path)
def is_enroute(self):
return self.destination is not None
def current_location(self):
if self.path == None:
return (self.source.x, self.source.y)
else:
return self.path[self.location_pointer]
def try_loading(self, quantity):
if self.source.storage.try_take_units({ self.product_id: quantity }):
self.payload = quantity