예제 #1
0
 def LoadNetwork(self, fname):
   '''! \brief Load network infrastructure from the map XML file.
   '''
   if self.network == None:
     self.network = sandbox_network()
   try:
     doc = sandboXML(read=fname)
     self.network.LoadFromXML(doc)
   except:
     pass
     
   return self.network
예제 #2
0
  def __init__(self, scenario='blankworld.xml'):
    # compatibility
    self.version = '0.1'
    self.OS = {}
    
    # Initialize all sorts of variables
    # The root node of the order of battle
    self.OOB = []
  
    # The Database daemon
    self.data = sandbox_data_server()
    
    # communication net
    # The communication stack
    self.COMMnets = {}
    
    # Each unit gets it own UID, this is the counter that keeps track of this
    self.next_uid = 1

    # A list of ongoing maneuver battles.
    self.engagements = []
    
    # A register of counter-battery units [ uid , uid, ...] 
    self.counterbattery = []
    self.sead = []
    
    #Strikes counter measures
    self.SEADMisions = []
    self.CounterBtyMissions = []
    self.strikeQueue = []
    
    # Infrastructure
    self.network = sandbox_network()
    
    # Clock
    self.clock = datetime.today()
    self.pulse = timedelta(minutes = 10.0)
    self.lastpulse = datetime.today()
    
    # Scheduler
    self.scheduler = sandbox_Scheduler()
    
    # Sides registration (rgb colors)
    self.sides = {}
    
    # Load the Scenario definition
    self.LoadFromFile(scenario)