Skip to content

Commit

Permalink
removing circular import #12
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Jul 8, 2024
1 parent 0d478be commit bbd3a83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion tools/drt/drtOrtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import sumolib # noqa
import traci # noqa

SPEED_DEFAULT = 20 # default vehicle speed in m/s
PENALTY_FACTOR = 'dynamic' # factor on penalty for rejecting requests


Expand Down
6 changes: 3 additions & 3 deletions tools/drt/orToolsDataModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import numpy as np
import math

import drtOrtools

# SUMO modules
# we need to import python modules from the $SUMO_HOME/tools directory
if 'SUMO_HOME' in os.environ:
Expand All @@ -38,6 +36,8 @@
import traci._person
import traci._simulation

SPEED_DEFAULT = 20 # default vehicle speed in m/s


class CostType(Enum):
DISTANCE = 1
Expand Down Expand Up @@ -171,7 +171,7 @@ def get_penalty(self, explicitly_time_related: bool = False) -> int:
if not explicitly_time_related:
return self.penalty
if self.cost_type == CostType.DISTANCE:
return round(self.penalty * drtOrtools.SPEED_DEFAULT)
return round(self.penalty * SPEED_DEFAULT)
else:
return self.penalty

Expand Down

0 comments on commit bbd3a83

Please sign in to comment.