Skip to content

Commit

Permalink
replace wildcard imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Bonifatius94 committed Jan 5, 2024
1 parent c07e2c9 commit 5340cfb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
8 changes: 4 additions & 4 deletions examples/example02.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"""
import pysocialforce as pysf

obstacle01 = pysf.map_config.Obstacle(
obstacle01 = pysf.Obstacle(
[(10, 10), (15,10), (15, 15), (10, 15)])
obstacle02 = pysf.map_config.Obstacle(
obstacle02 = pysf.Obstacle(
[(20, 10), (25,10), (25, 15), (20, 15)])

route01 = pysf.map_config.GlobalRoute(
route01 = pysf.GlobalRoute(
[(0, 0), (10, 10), (20, 10), (30, 0)])
crowded_zone01 = ((10, 10), (20, 10), (20, 20))

map_def = pysf.map_config.MapDefinition(
map_def = pysf.MapDefinition(
obstacles=[obstacle01, obstacle02],
routes=[route01],
crowded_zones=[crowded_zone01])
Expand Down
10 changes: 5 additions & 5 deletions examples/example03.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
import pysocialforce as pysf
import numpy as np

obstacle01 = pysf.map_config.Obstacle(
obstacle01 = pysf.Obstacle(
[(10, 10), (15,10), (15, 15), (10, 15)])
obstacle02 = pysf.map_config.Obstacle(
obstacle02 = pysf.Obstacle(
[(20, 10), (25,10), (25, 15), (20, 15)])

route01 = pysf.map_config.GlobalRoute(
route01 = pysf.GlobalRoute(
[(0, 0), (10, 10), (20, 10), (30, 0)])
crowded_zone01 = ((10, 10), (20, 10), (20, 20))

map_def = pysf.map_config.MapDefinition(
map_def = pysf.MapDefinition(
obstacles=[obstacle01, obstacle02],
routes=[route01],
crowded_zones=[crowded_zone01])
Expand All @@ -30,7 +30,7 @@
np.expand_dims(ped_pos, axis=1),
np.expand_dims(ped_pos + ped_vel, axis=1)
), axis=1)
state = pysf.sim_view.VisualizableSimState(step, ped_pos, actions)
state = pysf.VisualizableSimState(step, ped_pos, actions)
sim_view.render(state, fps=10)

sim_view.exit()
15 changes: 12 additions & 3 deletions pysocialforce/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
"""Numpy implementation of the Social Force model."""

__version__ = "1.1.2"
__version__ = "2.0.0"

from .logging import *
from .logging import logger
from .config import \
SimulatorConfig, DesiredForceConfig, GroupCoherenceForceConfig, \
GroupGazeForceConfig, GroupReplusiveForceConfig, ObstacleForceConfig, \
PedSpawnConfig, SceneConfig, SocialForceConfig
from .simulator import Simulator, Simulator_v2
from .forces import *
from .forces import \
Force, DebuggableForce, DesiredForce, GroupCoherenceForceAlt, \
GroupGazeForceAlt, GroupRepulsiveForce, ObstacleForce, SocialForce
from .sim_view import SimulationView, VisualizableSimState
from .map_config import \
Circle, Line2D, Rect, Zone, Vec2D, \
GlobalRoute, Obstacle, MapDefinition

0 comments on commit 5340cfb

Please sign in to comment.