@startuml

package model {
    class CityMap {
       #List<Route> shortestPath(startWayPoint: AbstractWayPoint, endWayPoints: List<AbstractWayPoint>)
       +DeliveryGraph computeDeliveryGraph(request: DeliveryRequest)
       +List<Intersection> getIntersections()
       +List<StreetSection> getStreetSections()
       +Intersection getIntersection(idIntersection: int)
    }

    class DeliveryGraph {
        +int size()
        +Route getRoute(startId: int, endId: int)
    }

    class StreetSection {
        -length: int
        -duration: int
        -streetName: String
        +Intersection getStartIntersection()
        +Intersection getEndIntersection()
        +int getDuration()
    }

    class Intersection {
        -id: int
        -x: int
        -y: int
        +int getX()
        +int getY()
        #int getId()
    }

    abstract class AbstractWayPoint {
    	-deliveryTimeStart: int
    	-deliveryTimeEnd: int
        +{abstract} int getDuration()
        +int getDeliveryTimeStart()
        +int getDeliveryTimeEnd()
        +Intersection getIntersection()
        +int getX()
        +int getY()
        #int getId()
    }

    class DeliveryAddress {
        -deliveryDuration: int
        +int getDuration()
    }

    class Warehouse {
        -loadingDuration
        +int getDuration()
    }

    class DeliveryRequest {
        -startTime: int
        +void addDeliveryAddress(address: DeliveryAddress)
        +void removeDeliveryAddress(address: DeliveryAddress)
    }

    class Planning {
        +int getFullTime()
        +int getRoutes()
        +Planning addWayPoint(point: AbstractWayPoint, map: CityMap)
        +Planning addWayPoint(point: AbstractWayPoint, afterPoint: AbstractWayPoint, map: CityMap)
        +Planning removeWayPoint(point: AbstractWayPoint, map: CityMap)
    }

    class Route {
        -duration: int
        +Waypoint getStartWaypoint()
        +Waypoint getEndWaypoint()
        +int getDuration()
    }

    CityMap o-- StreetSection
    CityMap o-- Intersection
    AbstractWayPoint --> Intersection
    StreetSection --> Intersection : end
    StreetSection --> Intersection : start
    Route o-- StreetSection
    Route --> AbstractWayPoint : end
    Route --> AbstractWayPoint : start
    AbstractWayPoint <|-- DeliveryAddress
    AbstractWayPoint <|-- Warehouse
    DeliveryRequest o-- DeliveryAddress
    DeliveryRequest -left-> Warehouse : warehouse
    DeliveryGraph o-- Route : routes
    Planning o-- Route
}



@enduml
