Ejemplo n.º 1
0
 def __init__(self, station, name):
     self.station = station
     self.door_name = name
     self.trpe = 'Shipping'
     self.truck = None
     self.status = ['empty', 'loading', 'waiting']
     self.status_number = 0
     self.good_list = GoodStore()
     self.sequence = []
     self.station = station
     self.waiting_trucks = 0
     self.loading_truck = None
     self.reserved_goods = GoodStore()
     self.finish_time = 0
     self.current_time = 0
Ejemplo n.º 2
0
 def load_goods(self, current_time):
     self.current_time = current_time
     self.loading_truck.going_goods = deepcopy(self.reserved_goods)
     self.reserved_goods = GoodStore()
     self.next_state()
     self.finish_time = current_time + self.loading_truck.changeover_time
     if self.sequence:
         self.sequence.pop(0)
 def __init__(self, name):
     self.element_name = name
     self.truck_list = []
     self.door_empty = True
     self.good_store = GoodStore()
     self.good_transfer_time = 0
     self.transfer_finished = False
     self.station = 0
Ejemplo n.º 4
0
    def __init__(self, transfer_time):
        """
        Initialize the station by creating doors and types
        :return:
      """

        self.receiving_doors = {}
        self.shipping_doors = {}
        self.not_ready_goods = {}
        self.station_goods = GoodStore()
        self.good_transfer_time = transfer_time
Ejemplo n.º 5
0
    def __init__(self):
        self.element_name = ""
        self.truck_type = ""
        self.truck_times = OrderedDict()
        self.state_functions = OrderedDict()
        self.truck_states = []
        self.state_change = False
        self.coming_time = 0
        self.changeover_time = 0
        self.good_loading_time = 0
        self.good_unloading_time = 0
        self.good_transfer_time = 0
        self.station = 0
        self.lower_boundary = 0
        self.upper_boundary = 0
        self.coming_good_store = GoodStore()
        self.going_good_store = GoodStore()
        self.coming_good_dict = dict()
        self.going_good_dict = dict()
        self.state = 0
        self.current_time = 0
        self.truck_results = TruckResults()
        self.first_door = ""
        self.second_door = ""
        self.current_door = ""
        self.next_state_time = 0
        self.simulation_state = 0
        self.truck_transfer_time = 0

        # define state functions
        self.state_functions["coming"] = self.coming
        self.state_functions["waiting_to_deploy"] = self.waiting_to_deploy
        self.state_functions["waiting_to_load"] = self.waiting_to_load
        self.state_functions["changeover_load"] = self.changeover_load
        self.state_functions["changeover_deploy"] = self.changeover_deploy
        self.state_functions["deploying"] = self.deploying
        self.state_functions["changeover_fin"] = self.changeover_fin
        self.state_functions["changeover_mid"] = self.changeover_mid
        self.state_functions["not_enough_goods"] = self.not_enough_goods
        self.state_functions["loading"] = self.loading
        self.state_functions["done"] = self.done
Ejemplo n.º 6
0
 def __init__(self, truck_data, outbound_data):
     Truck.__init__(self, truck_data)
     self.truck_type = 1
     self.state_list = ('coming', 'waiting_to_load', 'not_ready_to_load', 'ready_to_load', 'must_load', 'loading', 'done')
     self.going_goods = GoodStore()
     self.going_good_amounts = {}
     self.finish_time = 0
     self.outbound_gdj = 0
     self.shipping_door = 0
     self.shipping_door_name = None
     self.arrival_time = outbound_data['arrival_time']
     self.mu = outbound_data['mu']
     self.product_per_truck = outbound_data['product_per_truck']
Ejemplo n.º 7
0
    def __init__(self, truck_data, compound_data):
        Truck.__init__(self, truck_data)
        self.truck_type = 2
        self.state_list = ('coming', 'waiting', 'start_deploy', 'deploying', 'transfering', 'waiting_to_load', 'not_needed_to_load', 'ready_to_load', 'must_load', 'loading', 'done')
        self.coming_goods = GoodStore()
        self.going_goods = GoodStore()

        self.coming_good_amounts = {}
        self.going_good_amounts = {}
        self.inbound_gdj = 0
        self.outbound_gdj = 0
        self.finish_time = 0
        self.receiving_door = 0
        self.shipping_door = 0
        self.receiving_door_name = None
        self.shipping_door_name = None

        # compound truck data
        self.arrival_time = compound_data['arrival_time']
        self.mu = compound_data['mu']
        self.transfer_time = compound_data['transfer_time']
        self.inbound_product_per_truck = compound_data['inbound_product_per_truck']
        self.outbound_product_per_truck = compound_data['outbound_product_per_truck']
Ejemplo n.º 8
0
    def __init__(self, truck_data, inbound_data):
        Truck.__init__(self, truck_data)
        self.truck_type = 0
        self.state_list = ('coming', 'waiting', 'start_deploy', 'deploying', 'done')

        self.arrival_time = inbound_data['arrival_time']
        self.mu = inbound_data['mu']
        self.product_per_truck = inbound_data['product_per_truck']

        self.inbound_gdj = 0
        self.door_number = 0
        self.receive_door = 0
        self.coming_good_amounts = {}
        self.bounds = 0
        self.coming_goods = GoodStore()
 def __init__(self):
     self.truck_type = ""
     self.truck_name = ""
     self.times = dict()
     self.coming_goods = GoodStore()
     self.going_goods = GoodStore()
Ejemplo n.º 10
0
 def __init__(self):
     self.good_store = GoodStore()
Ejemplo n.º 11
0
from src.good_store import GoodStore

good_store = GoodStore()
good_store.add_good_type(0)
good_store.add_good_type(1)
good_store.add_good_type(3)

print(good_store.good_amounts)
print(good_store.good_dictionary)

good_store.add_good(50, 0, 'inbound0')
good_store.add_good(50, 0, 'inbound1')

print(good_store.good_amounts)
print(good_store.good_dictionary)

good_store.add_good(200, 2, 'inbound0')
good_store.add_good(200, 1, 'inbound0')
print(good_store.good_amounts)
print(good_store.good_dictionary)

remove_dict = {0: 100, 1: 200, 2:100}
removed = good_store.remove_good(remove_dict)
print(removed)
print(good_store.good_amounts)
print(good_store.good_dictionary)
for good_list in removed.values():
    good_list.print_goods()

good_store.add_good_dict(removed)
print(good_store.good_amounts)