Commit 599d087e authored by Jérome Perrin's avatar Jérome Perrin

also return a list in GUI/Default

parent 02823f12
......@@ -80,7 +80,7 @@ class Simulation(DefaultSimulation):
ant['key'] = ant_key
# TODO: those two steps have to be parallelized
ant['result'] = DefaultSimulation.run(self, ant_data)
ant['result'] = DefaultSimulation.runOneScenario(self, ant_data)
ant['score'] = self._calculateAntScore(ant)
# The ants in this generation are ranked based on their scores and the
......
......@@ -217,5 +217,15 @@ class Simulation(object):
},
}
def run(self, data):
def runOneScenario(self, data):
"""Run one scenario.
To be reused by subclasses.
"""
return json.loads(simulate_line_json(input_data=json.dumps(data)))
def run(self, data):
"""Run simulation and return result to the GUI.
"""
return [{"key": "default",
"score": 0,
"result": self.runOneScenario(data)}]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment