INNER CODE UNIT · Python

TerrainCell

ikatsov/tensor-house · supply-chain/world_of_supply/world_of_supply_environment.py:48

class TerrainCell(Cell):
    def __init__(self, x, y):
        super(TerrainCell, self).__init__(x, y)

class RailroadCell(Cell):
    def __init__(self, x, y):
        super(RailroadCell, self).__init__(x, y)

        
# ======= Transportation
class Transport(Agent):
    
    @dataclass 
    class Economy:
        unit_transport_cost: int   # cost per unit per movement
        
        def step_balance_sheet(self, transport):
            return BalanceSheet(0, -transport.payload * self.unit_transport_cost * abs(transport.step))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…