Exemple #1
0
 def startNextFloor(self):
     if self.avIds:
         print self.avIds
         self.currentFloor += 1
         specModule = self.layout.getFloorSpec(self.currentFloor)
         self.level.requestDelete()
         self.level = DistributedLawOfficeFloorAI.DistributedLawOfficeFloorAI(self.air, self.lawOfficeId, self.zoneId, self.entranceId, self.avIds, specModule)
         self.level.setLevelSpec(LevelSpec.LevelSpec(specModule))
         self.level.generateWithRequired(self.zoneId)
         print 'exchanging elevators'
         self.exchangeElevators()
         self.startSignal()
Exemple #2
0
 def startOffice(self):
     self.notify.info('loading spec')
     specModule = self.layout.getFloorSpec(self.currentFloor)
     self.level = DistributedLawOfficeFloorAI.DistributedLawOfficeFloorAI(self.air, self.lawOfficeId, self.zoneId, self.entranceId, self.avIds, specModule)
     self.level.setLevelSpec(LevelSpec.LevelSpec(specModule))
     self.notify.info('creating entities')
     self.level.generateWithRequired(self.zoneId)
     self.elevator = DistributedElevatorFloorAI.DistributedElevatorFloorAI(self.air, self.doId, self, self.avIds)
     self.elevator.setEntering(0)
     self.elevator.generateWithRequired(self.zoneId)
     self.elevatorB = DistributedElevatorFloorAI.DistributedElevatorFloorAI(self.air, self.doId, self, self.avIds)
     self.elevatorB.setEntering(1)
     self.elevatorB.generateWithRequired(self.zoneId)
     self.exchangeElevators()
Exemple #3
0
    def startNextFloor(self):
        #print("LOADING NEXT FLOOR!!!!! %s" % (self.currentFloor + 1))
        #print self.layout.floorIds

        if self.avIds:
            print(self.avIds)
            self.currentFloor += 1
            specModule = self.layout.getFloorSpec(self.currentFloor)

            #self.currentFloorZone = self.air.allocateZone()
            self.level.requestDelete()

            self.level = DistributedLawOfficeFloorAI.DistributedLawOfficeFloorAI(
                self.air, self.lawOfficeId, self.zoneId, self.entranceId,
                self.avIds, specModule)
            self.level.setLevelSpec(LevelSpec.LevelSpec(specModule))
            self.level.generateWithRequired(self.zoneId)

            print("exchanging elevators")
            self.exchangeElevators()
            self.startSignal()
Exemple #4
0
    def startOffice(self):
        #print("LOADING FIRST FLOOR!!!!! %s" % (self.currentFloor))

        # create our first floor
        self.notify.info('loading spec')
        specModule = self.layout.getFloorSpec(self.currentFloor)
        self.level = DistributedLawOfficeFloorAI.DistributedLawOfficeFloorAI(
            self.air, self.lawOfficeId, self.zoneId, self.entranceId,
            self.avIds, specModule)
        self.level.setLevelSpec(LevelSpec.LevelSpec(specModule))
        #self.currentFloorZone = self.air.allocateZone()

        self.notify.info('creating entities')
        self.level.generateWithRequired(self.zoneId)

        #print("STARTING TOONBARRIER FOR %s" % (self.avIds))
        #self.__barrier = ToonBarrier(
        #    'waitClientsFinishFloor',
        #    self.uniqueName('waitClientsFinishFloor'),
        #    self.avIds, 10000,
        #    self.startNextFloor, self.dumpEveryone)

        #Start: Add the connecting elevator--------------------

        #print("START SETTING UP ELEVATORS!!!")
        self.elevator = DistributedElevatorFloorAI.DistributedElevatorFloorAI(
            self.air, self.doId, self, self.avIds)
        #self.elevator.setLocked(0)
        self.elevator.setEntering(0)
        self.elevator.generateWithRequired(self.zoneId)
        self.elevatorB = DistributedElevatorFloorAI.DistributedElevatorFloorAI(
            self.air, self.doId, self, self.avIds)
        #self.elevatorB.setLocked(0)
        self.elevatorB.setEntering(1)
        self.elevatorB.generateWithRequired(self.zoneId)
        #self.unlockElevator()
        #self.elevator.unlock()
        #self.elevatorB.unlock()
        self.exchangeElevators()