# coding: utf-8

"""
    VeeRoute.LSS Lastmile

    VeeRoute.LSS Lastmile API  # noqa: E501

    The version of the OpenAPI document: 3.6.163073
    Contact: support@veeroute.com
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import unittest
import datetime

import vrt_lss_lastmile
from vrt_lss_lastmile.models.plan_task import PlanTask  # noqa: E501
from vrt_lss_lastmile.rest import ApiException

class TestPlanTask(unittest.TestCase):
    """PlanTask unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def make_instance(self, include_optional):
        """Test PlanTask
            include_option is a boolean, when False only required
            params are included, when True both required and
            optional params are included """
        # model = vrt_lss_lastmile.models.plan_task.PlanTask()  # noqa: E501
        if include_optional :
            return PlanTask(
                locations = [
                    vrt_lss_lastmile.models.advanced_location.AdvancedLocation(
                        key = 'location01', 
                        location = vrt_lss_lastmile.models.location.Location(
                            latitude = 55.692789, 
                            longitude = 37.554554, 
                            arrival_duration = 15, 
                            departure_duration = 5, ), 
                        transport_restrictions = ["2T"], 
                        load_windows = [
                            vrt_lss_lastmile.models.load_window.LoadWindow(
                                time_window = vrt_lss_lastmile.models.time_window.TimeWindow(
                                    from = '2020-10-21T09:30+03:00', 
                                    to = '2020-10-21T19:45Z', ), 
                                gates_count = 1, )
                            ], )
                    ], 
                orders = [
                    vrt_lss_lastmile.models.order.Order(
                        key = 'order01', 
                        order_features = ["Special"], 
                        order_restrictions = ["Special"], 
                        performer_restrictions = ["Special"], 
                        performer_blacklist = ["A0"], 
                        cargos = [
                            vrt_lss_lastmile.models.cargo.Cargo(
                                key = 'cargo01', 
                                capacity = vrt_lss_lastmile.models.capacity.Capacity(
                                    mass = 10, 
                                    volume = 2, 
                                    capacity_x = 1, 
                                    capacity_y = 2, 
                                    capacity_z = 3, ), 
                                rotation = ["ALL"], 
                                width = 1, 
                                height = 0.3, 
                                length = 2.2, 
                                max_storage_time = 60, 
                                restrictions = ["Freezer"], )
                            ], 
                        demands = [
                            vrt_lss_lastmile.models.demand.Demand(
                                key = 'demand_1', 
                                demand_type = 'WORK', 
                                target_cargos = ["cargo01"], 
                                precedence_in_trip = 1, 
                                precedence_in_order = 1, 
                                possible_events = [
                                    vrt_lss_lastmile.models.possible_event.PossibleEvent(
                                        location_key = 'location01', 
                                        duration = 10, 
                                        reward = 199.9, 
                                        time_window = vrt_lss_lastmile.models.time_window.TimeWindow(
                                            from = '2020-10-21T09:30+03:00', 
                                            to = '2020-10-21T19:45Z', ), 
                                        soft_time_window = vrt_lss_lastmile.models.time_window.TimeWindow(
                                            from = '2020-10-21T09:30+03:00', 
                                            to = '2020-10-21T19:45Z', ), )
                                    ], )
                            ], )
                    ], 
                performers = [
                    vrt_lss_lastmile.models.performer.Performer(
                        key = 'performer0001', 
                        max_work_shifts = 3, 
                        performer_features = ["B1","Special"], 
                        transport_restrictions = ["B1"], 
                        own_transport_type = 'CAR', )
                    ], 
                transports = [
                    vrt_lss_lastmile.models.transport.Transport(
                        key = 'transport0001', 
                        transport_type = 'CAR', 
                        transport_features = ["20T"], 
                        performer_restrictions = ["B1"], 
                        boxes = [
                            vrt_lss_lastmile.models.box.Box(
                                key = 'box01', 
                                capacity = vrt_lss_lastmile.models.capacity.Capacity(
                                    mass = 10, 
                                    volume = 2, 
                                    capacity_x = 1, 
                                    capacity_y = 2, 
                                    capacity_z = 3, ), 
                                max_size = vrt_lss_lastmile.models.capacity.Capacity(
                                    mass = 10, 
                                    volume = 2, 
                                    capacity_x = 1, 
                                    capacity_y = 2, 
                                    capacity_z = 3, ), 
                                width = 1, 
                                height = 3.1, 
                                length = 2.1, 
                                features = ["Freezer"], )
                            ], )
                    ], 
                shifts = [
                    vrt_lss_lastmile.models.shift.Shift(
                        key = 'shift01', 
                        shift_type = 'PERFORMER', 
                        resource_key = 'performer01', 
                        availability_time = vrt_lss_lastmile.models.time_window.TimeWindow(
                            from = '2020-10-21T09:30+03:00', 
                            to = '2020-10-21T19:45Z', ), 
                        working_time = vrt_lss_lastmile.models.time_window.TimeWindow(
                            from = '2020-10-21T09:30+03:00', 
                            to = '2020-10-21T19:45Z', ), 
                        start_location_key = 'location01', 
                        finish_location_key = 'location01', 
                        tariff = vrt_lss_lastmile.models.universal_tariff.UniversalTariff(
                            cost_per_shift = 2000, 
                            constraints = [
                                vrt_lss_lastmile.models.tariff_constraint.TariffConstraint(
                                    stage_length = 200000, 
                                    cost_per_unit = 1.5, )
                                ], ), )
                    ], 
                hardlinks = [
                    vrt_lss_lastmile.models.hardlink.Hardlink(
                        key = 'group01', 
                        links = [
                            vrt_lss_lastmile.models.hardlink_links.Hardlink_links(
                                type = 'ORDER', 
                                entity_key = 'ord0001', )
                            ], )
                    ], 
                trips = [
                    vrt_lss_lastmile.models.trip.Trip(
                        key = 'TRIP0001', 
                        assigned_shifts = [
                            vrt_lss_lastmile.models.assigned_shift.AssignedShift(
                                shift_key = 'performer01', 
                                shift_time = vrt_lss_lastmile.models.time_window.TimeWindow(
                                    from = '2020-10-21T09:30+03:00', 
                                    to = '2020-10-21T19:45Z', ), )
                            ], 
                        actions = [
                            vrt_lss_lastmile.models.trip_action.TripAction(
                                order_key = 'order01', 
                                demand_key = 'demand01.1', 
                                location_key = 'location01', 
                                todolist = [
                                    vrt_lss_lastmile.models.trip_job.TripJob(
                                        job_type = 'START_WORK', 
                                        job_time = '2020-10-21T09:30+03:00', )
                                    ], 
                                cargo_placements = [
                                    vrt_lss_lastmile.models.cargo_placement.CargoPlacement(
                                        box_key = 'box01', 
                                        cargo_key = 'cargo01', )
                                    ], )
                            ], 
                        waitlist = ["order02"], 
                        start_location_key = 'location01', 
                        finish_location_key = 'location01', )
                    ], 
                settings = vrt_lss_lastmile.models.plan_settings.PlanSettings(
                    configuration = 'default', 
                    planning_time = 30, 
                    result_ttl = 10, 
                    result_timezone = 3, 
                    predict_slots = 2, 
                    transport_factor = [
                        vrt_lss_lastmile.models.transport_factor.TransportFactor(
                            transport_type = 'CAR', 
                            speed = 2.5, )
                        ], 
                    capacity_factor = [
                        vrt_lss_lastmile.models.capacity_factor.CapacityFactor(
                            transport_type = 'CAR', 
                            capacity = vrt_lss_lastmile.models.capacity.Capacity(
                                mass = 10, 
                                volume = 2, 
                                capacity_x = 1, 
                                capacity_y = 2, 
                                capacity_z = 3, ), )
                        ], 
                    routing = [
                        vrt_lss_lastmile.models.routing.Routing(
                            transport_type = 'CAR', 
                            matrix = {"waypoints":[{"latitude":59.9345,"longitude":30.1504},{"latitude":59.942383,"longitude":30.258951},{"latitude":59.9545,"longitude":30.2004},{"latitude":59.89527,"longitude":30.261747},{"latitude":59.9745,"longitude":30.5004}],"distances":[[0,5822,1820,14130,23304],[5936,0,4931,8365,17731],[1819,4853,0,13161,22335],[14859,9056,13854,0,21440],[21777,16306,20772,19290,0]],"durations":[[0,13,7,24,36],[13,0,9,13,25],[7,9,0,21,32],[26,14,22,0,30],[34,23,30,28,0]]}, 
                            traffic_jams = [
                                vrt_lss_lastmile.models.traffic_factor.TrafficFactor(
                                    time_window = vrt_lss_lastmile.models.time_window.TimeWindow(
                                        from = '2020-10-21T09:30+03:00', 
                                        to = '2020-10-21T19:45Z', ), 
                                    length_multiplier = 2, 
                                    length_additive = 20, 
                                    time_multiplier = 2, 
                                    time_additive = 30, )
                                ], )
                        ], 
                    assumptions = vrt_lss_lastmile.models.plan_assumptions.PlanAssumptions(
                        toll_roads = False, 
                        ferry_crossing = False, 
                        flight_distance = True, 
                        disable_compatibility = True, 
                        disable_capacity = True, 
                        same_order_time_window = True, 
                        expand_shift_time_window = True, ), 
                    precision = 3, )
            )
        else :
            return PlanTask(
                locations = [
                    vrt_lss_lastmile.models.advanced_location.AdvancedLocation(
                        key = 'location01', 
                        location = vrt_lss_lastmile.models.location.Location(
                            latitude = 55.692789, 
                            longitude = 37.554554, 
                            arrival_duration = 15, 
                            departure_duration = 5, ), 
                        transport_restrictions = ["2T"], 
                        load_windows = [
                            vrt_lss_lastmile.models.load_window.LoadWindow(
                                time_window = vrt_lss_lastmile.models.time_window.TimeWindow(
                                    from = '2020-10-21T09:30+03:00', 
                                    to = '2020-10-21T19:45Z', ), 
                                gates_count = 1, )
                            ], )
                    ],
                orders = [
                    vrt_lss_lastmile.models.order.Order(
                        key = 'order01', 
                        order_features = ["Special"], 
                        order_restrictions = ["Special"], 
                        performer_restrictions = ["Special"], 
                        performer_blacklist = ["A0"], 
                        cargos = [
                            vrt_lss_lastmile.models.cargo.Cargo(
                                key = 'cargo01', 
                                capacity = vrt_lss_lastmile.models.capacity.Capacity(
                                    mass = 10, 
                                    volume = 2, 
                                    capacity_x = 1, 
                                    capacity_y = 2, 
                                    capacity_z = 3, ), 
                                rotation = ["ALL"], 
                                width = 1, 
                                height = 0.3, 
                                length = 2.2, 
                                max_storage_time = 60, 
                                restrictions = ["Freezer"], )
                            ], 
                        demands = [
                            vrt_lss_lastmile.models.demand.Demand(
                                key = 'demand_1', 
                                demand_type = 'WORK', 
                                target_cargos = ["cargo01"], 
                                precedence_in_trip = 1, 
                                precedence_in_order = 1, 
                                possible_events = [
                                    vrt_lss_lastmile.models.possible_event.PossibleEvent(
                                        location_key = 'location01', 
                                        duration = 10, 
                                        reward = 199.9, 
                                        time_window = vrt_lss_lastmile.models.time_window.TimeWindow(
                                            from = '2020-10-21T09:30+03:00', 
                                            to = '2020-10-21T19:45Z', ), 
                                        soft_time_window = vrt_lss_lastmile.models.time_window.TimeWindow(
                                            from = '2020-10-21T09:30+03:00', 
                                            to = '2020-10-21T19:45Z', ), )
                                    ], )
                            ], )
                    ],
                performers = [
                    vrt_lss_lastmile.models.performer.Performer(
                        key = 'performer0001', 
                        max_work_shifts = 3, 
                        performer_features = ["B1","Special"], 
                        transport_restrictions = ["B1"], 
                        own_transport_type = 'CAR', )
                    ],
                transports = [
                    vrt_lss_lastmile.models.transport.Transport(
                        key = 'transport0001', 
                        transport_type = 'CAR', 
                        transport_features = ["20T"], 
                        performer_restrictions = ["B1"], 
                        boxes = [
                            vrt_lss_lastmile.models.box.Box(
                                key = 'box01', 
                                capacity = vrt_lss_lastmile.models.capacity.Capacity(
                                    mass = 10, 
                                    volume = 2, 
                                    capacity_x = 1, 
                                    capacity_y = 2, 
                                    capacity_z = 3, ), 
                                max_size = vrt_lss_lastmile.models.capacity.Capacity(
                                    mass = 10, 
                                    volume = 2, 
                                    capacity_x = 1, 
                                    capacity_y = 2, 
                                    capacity_z = 3, ), 
                                width = 1, 
                                height = 3.1, 
                                length = 2.1, 
                                features = ["Freezer"], )
                            ], )
                    ],
                shifts = [
                    vrt_lss_lastmile.models.shift.Shift(
                        key = 'shift01', 
                        shift_type = 'PERFORMER', 
                        resource_key = 'performer01', 
                        availability_time = vrt_lss_lastmile.models.time_window.TimeWindow(
                            from = '2020-10-21T09:30+03:00', 
                            to = '2020-10-21T19:45Z', ), 
                        working_time = vrt_lss_lastmile.models.time_window.TimeWindow(
                            from = '2020-10-21T09:30+03:00', 
                            to = '2020-10-21T19:45Z', ), 
                        start_location_key = 'location01', 
                        finish_location_key = 'location01', 
                        tariff = vrt_lss_lastmile.models.universal_tariff.UniversalTariff(
                            cost_per_shift = 2000, 
                            constraints = [
                                vrt_lss_lastmile.models.tariff_constraint.TariffConstraint(
                                    stage_length = 200000, 
                                    cost_per_unit = 1.5, )
                                ], ), )
                    ],
        )

    def testPlanTask(self):
        """Test PlanTask"""
        inst_req_only = self.make_instance(include_optional=False)
        inst_req_and_optional = self.make_instance(include_optional=True)


if __name__ == '__main__':
    unittest.main()
