Exemple #1
0
 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))
Exemple #2
0
def set_current_action(env, action):
    env.memory.insertData(MEM_CURRENT_ACTIONS, to_json_string(action))
Exemple #3
0
def save_plan(env, plan):
    env.memory.insertData(MEM_PLANNED_ACTIONS, to_json_string(plan))
Exemple #4
0
def save_completed_actions(env, actions):
    env.memory.insertData(MEM_COMPLETED_ACTIONS, to_json_string(actions))
Exemple #5
0
def save_event(env, event):
    env.memory.insertData(MEM_CURRENT_EVENT, to_json_string(event))