def json_serialisation(self, ev): json = to_json_string(ev) print "Serialisation of "+object_to_name(ev)+" = \n"+json self.assertIsNotNone(json, "Serialised object should not be None") rev = from_json_string(json) self.assertTrue(isinstance(rev, ev.__class__)) self.assertEqual(ev, rev, "Reconstituted object "+repr(rev)+" must equal original "+repr(ev))
def get_current_action(env): return from_json_string(env.memory.getData(MEM_CURRENT_ACTIONS))
def load_plan(env): return from_json_string(env.memory.getData(MEM_PLANNED_ACTIONS))
def load_completed_actions(env): return from_json_string(env.memory.getData(MEM_COMPLETED_ACTIONS))
def load_event(env): return from_json_string(env.memory.getData(MEM_CURRENT_EVENT))