diff --git a/mrs/ccu.py b/mrs/ccu.py index 57c5ef0e8..7552548d0 100644 --- a/mrs/ccu.py +++ b/mrs/ccu.py @@ -1,7 +1,7 @@ import logging import time -from fleet_management.api import API +from fmlib.api import API from fleet_management.config.config import FMSBuilder from fmlib.db.mongo import Store from fmlib.db.queries import get_tasks_by_status diff --git a/mrs/utils/datasets.py b/mrs/utils/datasets.py index e4b9fafff..de732af1a 100644 --- a/mrs/utils/datasets.py +++ b/mrs/utils/datasets.py @@ -5,8 +5,8 @@ from ropod.utils.timestamp import TimeStamp from ropod.utils.uuid import generate_uuid -from fmlib.models.tasks import Task, TaskRequest -from mrs.db.models.task import TaskLot +from fmlib.models.tasks import Task +from fmlib.models.requests import TransportationRequest from mrs.db.models.performance.task import TaskPerformance from mrs.db.models.performance.dataset import DatasetPerformance @@ -38,9 +38,9 @@ def load_yaml_dataset(dataset_path): task_info.get("latest_start_time")) hard_constraints = task_info.get("hard_constraints") - request = TaskRequest(request_id=generate_uuid(), pickup_location=start_location, - delivery_location=finish_location, earliest_pickup_time=earliest_start_time, - latest_pickup_time=latest_start_time, hard_constraints=hard_constraints) + request = TransportationRequest(request_id=generate_uuid(), pickup_location=start_location, + delivery_location=finish_location, earliest_pickup_time=earliest_start_time, + latest_pickup_time=latest_start_time, hard_constraints=hard_constraints) task = Task.create_new(task_id=task_id, request=request) diff --git a/mrs/utils/models.py b/mrs/utils/models.py deleted file mode 100644 index 429183c31..000000000 --- a/mrs/utils/models.py +++ /dev/null @@ -1,33 +0,0 @@ -from mrs.structs.allocation import TaskAnnouncement, Allocation, FinishRound -from mrs.structs.bid import Bid -from mrs.structs.timetable import Timetable -from ropod.utils.models import MessageFactoryBase - - -class MRSMessageFactory(MessageFactoryBase): - def __init__(self): - super().__init__() - - self.register_msg(TaskAnnouncement.__name__, self) - self.register_msg(Allocation.__name__, self) - self.register_msg(Bid.__name__, self) - self.register_msg(FinishRound.__name__, self) - self.register_msg(Timetable.__name__, self) - - def create_message(self, contents, recipients=[]): - if isinstance(contents, TaskAnnouncement): - model = 'TASK-ANNOUNCEMENT' - elif isinstance(contents, Allocation): - model = 'ALLOCATION' - elif isinstance(contents, Bid): - model = 'BID' - elif isinstance(contents, FinishRound): - model = 'FINISH-ROUND' - elif isinstance(contents, Timetable): - model = 'TIMETABLE' - - msg = self.get_header(model, recipients=recipients) - payload = self.get_payload(contents, model.lower()) - msg.update(payload) - return msg -