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)
from time import sleep logger=logging.getLogger("Universe") logger.setLevel(logging.DEBUG) #DEBUG INFO WARNING ERROR CRITICAL #create console handler and set level to debug ch = logging.StreamHandler() ch.setLevel(logging.INFO) #create formatter formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") #add formatter to ch ch.setFormatter(formatter) #add ch to logger logger.addHandler(ch) modA = DestinyModule() modDock = UnityModule() modB = ZvezdaModule() modDrag = DragonCargoModule() 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'''