Beispiel #1
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     document['_id'] = document.pop('task_id')
     document["constraints"] = TaskConstraints.from_payload(
         document.pop("constraints"))
     task_lot = TaskLot.from_document(document)
     return task_lot
Beispiel #2
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     document["earliest_time"] = dateutil.parser.parse(
         document.pop("earliest_time"))
     document["latest_time"] = dateutil.parser.parse(
         document.pop("latest_time"))
     return cls.from_document(document)
Beispiel #3
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     document['pickup'] = TimepointConstraint.from_payload(
         document.get('pickup'))
     document['duration'] = InterTimepointConstraint.from_payload(
         document.get('duration'))
     temporal_constraints = cls.from_document(document)
     return temporal_constraints
Beispiel #4
0
 def from_payload(cls, payload, **kwargs):
     document = Document.from_payload(payload)
     document['_id'] = document.pop('task_id')
     for key, value in kwargs.items():
         document[key] = value.from_payload(document.pop(key))
     task = cls.from_document(document)
     task.save()
     task.update_status(TaskStatusConst.UNALLOCATED)
     return task
Beispiel #5
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     document['_id'] = document.pop('task_id')
     performance = TaskPerformance.from_document(document)
     return performance
Beispiel #6
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     task_constraints = cls.from_document(document)
     return task_constraints
Beispiel #7
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     document["temporal"] = TransportationTemporalConstraints.from_payload(
         document.pop("temporal"))
     task_constraints = cls.from_document(document)
     return task_constraints
Beispiel #8
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     return cls.from_document(document)
Beispiel #9
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     document['_id'] = document.pop('robot_id')
     document["ztp"] = dateutil.parser.parse(document.pop("ztp"))
     timetable = Timetable.from_document(document)
     return timetable
Beispiel #10
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     document['_id'] = document.pop('robot_id')
     timetable = Timetable.from_document(document)
     return timetable
Beispiel #11
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     document['_id'] = document.pop('request_id')
     request = TransportationRequest.from_document(document)
     request.save()
     return request
Beispiel #12
0
 def from_payload(cls, payload):
     document = Document.from_payload(payload)
     document.pop("metamodel")
     return cls.from_dict(document)