Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Commit

Permalink
* Added "Service" class. #49
Browse files Browse the repository at this point in the history
  • Loading branch information
garciparedes committed Oct 19, 2019
1 parent 3c63981 commit 8fefed6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
43 changes: 43 additions & 0 deletions jinete/models/services.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from __future__ import annotations

import logging
from typing import (
TYPE_CHECKING,
)
from .constants import (
MAX_FLOAT,
)

if TYPE_CHECKING:
from typing import (
Dict,
Any,
)
from .positions import (
Position,
)

logger = logging.getLogger(__name__)


class Service(object):
__slots__ = (
'position',
'earliest',
'latest',
'duration',
)
identifier: str
position: Position
earliest: float
latest: float
duration: float

def __init__(self, position: Position, earliest: float = 0.0, latest: float = MAX_FLOAT, duration: float = 0.0):
self.position = position
self.earliest = earliest
self.latest = latest
self.duration = duration

def __deepcopy__(self, memo: Dict[int, Any]) -> Service:
return self
1 change: 0 additions & 1 deletion jinete/models/trips.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class Trip(object):
'destination_latest',
'destination_duration',
'on_time_bonus',
'load_capacity',
'capacity',
)
identifier: str
Expand Down

0 comments on commit 8fefed6

Please sign in to comment.