Exemplo n.º 1
0
    def __init__(self,name='DEFAULT',logger=util.generic_logger):
        if name=='BERTNERNIE':

            modA  = DestinyModule()
            modDock = UnityModule()    
            modB   = ZvezdaModule()
            modDrag = DragonCargoModule()
            modDrag.setup_simple_resupply()
                   
            self.station = Station(modDock, "BnE Station", logger)
            self.station.berth_module(None,None,modB, None, True)
            self.station.berth_module(None,None,modA, None, True)    
            self.station.berth_module(None,None,modDrag, None, True)
            
            '''rob = Robot('Robby')     
            rob.station = station
            station.actors[rob.id]=rob
            rob.location = modB.node('hall0')
            rob.xyz = modB.location'''
            
            ernie = Human('Ernest',station=self.station,logger=self.station.logger)
            self.station.actors[ernie.id] = ernie
            ernie.location = modA.node('hall0')
            ernie.xyz = modA.location
            
            bert = Human('Bertholomew',station=self.station,logger=self.station.logger)
            self.station.actors[bert.id] = bert
            bert.location = modB.node('hall0')
            bert.xyz = modB.location
            
            ernie.needs['WasteCapacityLiquid'].amt=0.1
            ernie.needs['Food'].set_amt_to_severity('HIGH')
            ernie.nutrition = [0.5, 0.5, 0.5, 0.5, 0.5]
            #modB.equipment['Electrolyzer'][3].broken=True

        elif name == 'DOCKINGTEST':
            '''Ernie, in a station badly needing resupply, gets a Dragon shipment.
                He installs a docking computer, docks Dragon, unloads food, loads waste, undocks Dragon, Dragon reenters'''
   
            modB   = ZvezdaModule()
            self.station = Station(modB, "Docker Station", logger)
            
            modDrag = DragonCargoModule()
            modDrag.setup_simple_resupply()
                       
            #TODO: position Dragon on "docking" approach, add docking task
            self.station.begin_docking_approach(modDrag)
            print modDrag.location, modDrag.orientation
            
            ernie = Human('Ernest',station=self.station,logger=self.station.logger)
            self.station.actors[ernie.id] = ernie
            ernie.location = modB.node('hall0')
            ernie.xyz = modB.location
                                    
        else: #'DEFAULT'
            modDock = UnityModule()                   
            self.station = Station(modDock, 'NewbieStation',logger)
Exemplo n.º 2
0
 modDrag.setup_simple_resupply()
        
 station = Station(modDock, 'NewbieStation', logger)
 station.berth_module(modDock,'CBM0',modA, None, True)
 station.berth_module(modDock,'CBM3',modB, None, True)    
 station.berth_module(modA,None,modDrag, None, True)
 
 '''rob = Robot('Robby')     
 rob.station = station
 station.actors[rob.id]=rob
 rob.location = modB.node('hall0')
 rob.xyz = modB.location'''
 
 ernie= Human('Bela Lugosi',station=station,logger=station.logger)
 station.actors[ernie.id] = ernie
 ernie.location = modA.node('hall0')
 ernie.xyz = modA.location
 
 ernie.needs['WasteCapacityLiquid'].amt=0.1
 ernie.needs['Food'].set_amt_to_severity('HIGH')
 ernie.nutrition = [0.5, 0.5, 0.5, 0.5, 0.5]
 #modB.equipment['Electrolyzer'][3].broken=True
 
   
 #modA.berth('CBM0', modB, 'CBM0')
 #for m in station.modules.values(): print m.short_id, m.location
 #for n in station.paths.edges(data=True): print n
 for i in range(1,10000):
     station.update(util.TIME_FACTOR/20.0)
     sleep(1/20.0)
     #print 'Robot task:', None if not rob.task else (rob.task.name,rob.location,rob.task.severity)