Esempio n. 1
0
 def run(self):
     while True:
         time = self.env.now
         received = yield self.order.get()
         Recorder().addMC('agv', 'vehicle1', self.env.now - time)
         movorder, putchannel, getchannel = received
         b = Blackboard()
         black_cap = b.get('[pallet]capacity')
         black_flag = b.get('[pallet]homogeneous')
         pallet = None
         if (movorder == MovementOrder.DRPI) or (movorder
                                                 == MovementOrder.INBD):
             black_size = b.get('[requirements]ordersize')
             pallet = PalletFactory.generate(black_cap, black_size,
                                             black_flag, None)
         else:
             requirements = CustomerRequirementFactory.generate(
                 b.get('[requirements]ordersize'))
             pallet = PalletFactory.generate(black_cap, 0, black_flag,
                                             requirements)
         if (movorder == MovementOrder.DRPI) or (movorder
                                                 == MovementOrder.DRPO):
             putchannel.put('REMOVE')
             yield self.env.timeout(self.transportationTime)
             package = yield getchannel.get()
         self.log('loading station;;', 2)
         yield self.env.timeout(self.transportationTime)
         putchannel.put(pallet)
Esempio n. 2
0
 def __init__(self, name, commchannel):
     b = Blackboard()
     self.controller = RobotProgram(name + '_sw', commchannel,
                                    b.get('[robot]time'),
                                    b.get('[robot]precision'))
     self.structure = Performing(name + '_hw', self.controller,
                                 b.get('[robot]mtbf'), b.get('[robot]mttr'))
Esempio n. 3
0
 def __init__(self, nname, fin, fout):
     self.name = nname
     self.channelIN = fin
     self.channelOUT = fout
     b = Blackboard()
     self.controller = StationLogic(nname + '_sw', b.get('[gate]opentime'),
                                    b.get('[gate]belttime'), fin, fout)
     self.structure = Performing(nname + '_hw', self.controller,
                                 b.get('[gate]mtbf'), b.get('[gate]mttr'))
Esempio n. 4
0
 def __init__(self, nname, mmtbf=0, mmttr=0):
     super().__init__(nname)
     self.owner = None
     self.mtbf = mmtbf
     self.mttr = mmttr
     board = Blackboard()
     self.finalTime = board.get('stoptime')
     self.debugLevel = board.get('debugLevel')
     self.working = True
     self.process = self.env.process(self.run())
Esempio n. 5
0
 def __init__(self, orderchannel):
     super().__init__('AGV', 0, 0)
     b = Blackboard()
     transportationTime = b.get('[agv]time')
     num = b.get('[agv]number')
     self.env = b.get('enviro')
     self.vehicles = list()
     for i in range(0, num):
         vchannel = Store(self.env)
         v = Vehicle('Vehicle_' + str(i), transportationTime, vchannel)
         self.vehicles.append((v, vchannel))
     self.orderChannel = orderchannel
Esempio n. 6
0
 def __init__(self, nname, agvcommchannel):
     super().__init__(nname)
     b = Blackboard()
     self.rbs = RuleBasedSystem(b.get('[RBS]maxattempts'))
     envy = b.get('enviro')
     self.accuracyParameter = b.get('[vision]accuracy')
     self.toagv = agvcommchannel
     #robot
     self.robotcomm = Store(envy)
     self.robot = Robot('robot', self.robotcomm)
     # stations
     ninputs = b.get('[stations]inumber')
     noutputs = b.get('[stations]onumber')
     nspas = b.get('[stations]spa')
     self.stations = dict()
     b.put('[Shared]packages', dict())
     b.put('[Shared]packages.dirtybit', dict())
     for sindex in range(0, ninputs):
         sname, stat = self.makeStation(sindex, envy)
         self.stations[sname] = (stat, StationDir.INPUT)
     for sindex in range(0, noutputs):
         sname, stat = self.makeStation(sindex + ninputs, envy)
         self.stations[sname] = (stat, StationDir.OUTPUT)
Esempio n. 7
0
 def __init__(self, name, agvchannel):
     b = Blackboard()
     self.controller = MainController(name + '_sw', agvchannel)
     self.structure = Performing(name + '_hw', self.controller,
                                 b.get('[controller]mtbf'),
                                 b.get('[controller]mttr'))