Exemple #1
0
 def start(self, time, sensors):
     """
     start of an episode
     """
     org = self.get_org()
     org.time_alive += 1
     if (org.time_alive > 1):
         module.getServer().write_data(self.stats())
     # at the beginning of a physical life cycle, print the organism deets
     # FIXME: this causes lots of giant files
     #tf = tempfile.NamedTemporaryFile(
     #    prefix='opennero-org-%05d-' % org.id,
     #    suffix='.xml',
     #    delete=False)
     #print >>tf, org
     return self.network_action(sensors)
Exemple #2
0
 def start(self, time, sensors):
     """
     start of an episode
     """
     org = self.get_org()
     org.time_alive += 1
     if (org.time_alive > 1):
         module.getServer().write_data(self.stats())
     # at the beginning of a physical life cycle, print the organism deets
     # FIXME: this causes lots of giant files
     #tf = tempfile.NamedTemporaryFile(
     #    prefix='opennero-org-%05d-' % org.id,
     #    suffix='.xml',
     #    delete=False)
     #print >>tf, org        
     return self.network_action(sensors)
Exemple #3
0
def ModTick(dt):
    mod = module.getMod()
    if mod.environment:
        mod.environment.tick(dt)
    if OpenNero.getAppConfig().rendertype == 'null':
        return
    script_server = module.getServer()
    data = script_server.read_data()
    while data:
        module.parseInput(data.strip())
        data = script_server.read_data()
Exemple #4
0
def ModTick(dt):
    mod = module.getMod()
    if mod.environment:
        mod.environment.tick(dt)
    if OpenNero.getAppConfig().rendertype == 'null':
        return
    script_server = module.getServer()
    data = script_server.read_data()
    while data:
        module.parseInput(data.strip())
        data = script_server.read_data()