Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/DongChen06/MARL_CAVs
/ functions
Functions
435 in github.com/DongChen06/MARL_CAVs
⨍
Functions
435
◇
Types & classes
60
↓ 45 callers
Method
get_lane
Get the lane geometry corresponding to a given index in the road network. :param index: a tuple (origin node, destination node, lane
highway-env/highway_env/road/road.py:39
↓ 41 callers
Method
load
(self, model_dir, global_step=None, train_mode=False)
MARL/MAPPO.py:328
↓ 36 callers
Function
smooth
(x, timestamps=9)
MARL/common/plot_benchmark_safety.py:7
↓ 28 callers
Method
pix
Convert a distance [m] to pixels [px]. :param length: the input distance [m] :return: the corresponding size [px]
highway-env/highway_env/road/graphics.py:38
↓ 25 callers
Method
reset
Reset the environment to it's initial configuration :return: the observation of the reset state
highway-env/highway_env/envs/common/abstract.py:173
↓ 19 callers
Method
local_coordinates
(self, position: np.ndarray)
highway-env/highway_env/road/lane.py:208
↓ 15 callers
Method
position
(self, longitudinal: float, lateral: float)
highway-env/highway_env/road/lane.py:200
↓ 15 callers
Method
step
(self)
MARL/single_agent/kfac.py:188
↓ 13 callers
Method
heading_at
(self, longitudinal: float)
highway-env/highway_env/road/lane.py:204
↓ 13 callers
Method
side_lanes
:param lane_index: the index of a lane. :return: indexes of lanes next to a an input lane, to its right or left.
highway-env/highway_env/road/road.py:147
↓ 12 callers
Method
act
Execute the action on the ego-vehicle. Most of the action mechanics are actually implemented in vehicle.act(action), where v
highway-env/highway_env/envs/common/action.py:36
↓ 12 callers
Method
surrounding_vehicles
Find the preceding and following vehicles of a given vehicle. :param vehicle: the vehicle whose neighbours must be found :pa
highway-env/highway_env/road/road.py:291
↓ 12 callers
Function
to_tensor_var
(x, use_cuda=True, dtype="float")
MARL/common/utils.py:42
↓ 11 callers
Method
is_reachable_from
Whether the lane is reachable from a given world position :param position: the world position [m] :return: is the lane reach
highway-env/highway_env/road/lane.py:78
↓ 11 callers
Method
lane_distance_to
Compute the signed distance to another vehicle along a lane. :param vehicle: the other vehicle :param lane: a lane :
highway-env/highway_env/vehicle/kinematics.py:160
↓ 10 callers
Function
intervals_product
Compute the product of two intervals :param a: interval [a_min, a_max] :param b: interval [b_min, b_max] :return: the interval of th
highway-env/highway_env/interval.py:11
↓ 9 callers
Method
change_coordinates
Perform a change of coordinate: rotation and centering. :param value: the object to transform :param matrix: is it a matrix
highway-env/highway_env/interval.py:230
↓ 8 callers
Method
neighbour_vehicles
Find the preceding and following vehicles of a given vehicle. :param vehicle: the vehicle whose neighbours must be found :par
highway-env/highway_env/road/road.py:349
↓ 8 callers
Method
render
Render the environment. Create a viewer if none exists, and use it to render an image. :param mode: the rendering mode
highway-env/highway_env/envs/common/abstract.py:528
↓ 7 callers
Function
acceleration
Compute an acceleration command with the Intelligent Driver Model. The acceleration is chosen so as to: - reach a target speed; - ma
highway-env/highway_env/envs/common/idm_controller.py:200
↓ 7 callers
Method
acceleration
Compute an acceleration command with the Intelligent Driver Model. The acceleration is chosen so as to: - reach a target spe
highway-env/highway_env/vehicle/behavior.py:111
↓ 7 callers
Method
add_lane
A lane is encoded as an edge in the road network. :param _from: the node at which the lane starts. :param _to: the node at w
highway-env/highway_env/road/road.py:25
↓ 6 callers
Method
__init__
(self, env: 'AbstractEnv', **kwargs)
highway-env/highway_env/envs/common/observation.py:18
↓ 6 callers
Method
create_from
(cls, vehicle: LinearVehicle)
highway-env/highway_env/vehicle/uncertainty/prediction.py:67
↓ 6 callers
Function
to_tensor_var
(x, use_cuda=True, dtype="float")
MARL/single_agent/utils_common.py:28
↓ 5 callers
Function
clip_position
Clip a position in the TTC grid, so that it stays within bounds. :param h: speed index :param i: lane index :param j: time index
highway-env/highway_env/envs/common/finite_mdp.py:151
↓ 5 callers
Method
close
Close the pygame window.
highway-env/highway_env/envs/common/graphics.py:146
↓ 5 callers
Method
local_coordinates
Convert a world position to local lane coordinates. :param position: a world position [m] :return: the (longitudinal, latera
highway-env/highway_env/road/lane.py:32
↓ 5 callers
Method
push
(self, states, actions, rewards, next_states=None, dones=None)
MARL/single_agent/Memory_common.py:66
↓ 5 callers
Method
save
(self, model_dir, global_step)
MARL/MAPPO.py:358
↓ 5 callers
Method
to_dict
(self, origin_vehicle=None, observe_intentions=True)
highway-env/highway_env/road/objects.py:49
↓ 5 callers
Method
width_at
Get the lane width at a given longitudinal lane coordinate. :param longitudinal: longitudinal lane coordinate [m] :return: t
highway-env/highway_env/road/lane.py:52
↓ 4 callers
Method
add_frame
(self, frame)
MARL/common/utils.py:78
↓ 4 callers
Method
after_end
(self, position: np.ndarray, longitudinal: float = None, lateral: float = None)
highway-env/highway_env/road/lane.py:92
↓ 4 callers
Method
evaluation
(self, env, output_dir, eval_episodes=1, is_train=True)
MARL/MAPPO.py:248
↓ 4 callers
Function
interval_absolute_to_local
Converts an interval in absolute x,y coordinates to an interval in local (longiturinal, lateral) coordinates :param position_i: the position
highway-env/highway_env/interval.py:89
↓ 4 callers
Function
mdp_controller
Perform a high-level action to change the desired lane or speed. - If a high-level action is provided, update the target spe
highway-env/highway_env/envs/common/mdp_controller.py:19
↓ 4 callers
Method
next_lane
Get the index of the next lane that should be followed after finishing the current lane. - If a plan is available and matches with c
highway-env/highway_env/road/road.py:67
↓ 4 callers
Method
sample
(self, batch_size)
MARL/single_agent/Memory_common.py:77
↓ 4 callers
Method
seed
(self, seeding: int = None)
highway-env/highway_env/envs/common/abstract.py:129
↓ 4 callers
Method
space
The action space.
highway-env/highway_env/envs/common/action.py:23
↓ 4 callers
Method
vec2pix
Convert a world position [m] into a position in the surface [px]. :param vec: a world position [m] :return: the coordinates
highway-env/highway_env/road/graphics.py:57
↓ 3 callers
Method
__init__
(self, env: 'AbstractEnv', **kwargs)
highway-env/highway_env/envs/common/action.py:19
↓ 3 callers
Method
_compute_headway_distance
(self, vehicle, )
highway-env/highway_env/envs/common/abstract.py:614
↓ 3 callers
Method
_get_available_actions
Get the list of currently available actions. Lane changes are not available on the boundary of the road, and speed changes are not av
highway-env/highway_env/envs/common/abstract.py:216
↓ 3 callers
Method
_is_colliding
(self, vehicle, other, other_trajectories)
highway-env/highway_env/envs/common/abstract.py:738
↓ 3 callers
Method
_is_colliding
(self, other)
highway-env/highway_env/vehicle/kinematics.py:201
↓ 3 callers
Method
_push_one
(self, state, action, reward, next_state=None, done=None)
MARL/single_agent/Memory_common.py:18
↓ 3 callers
Method
_push_one
(self, state, action, reward, next_state=None, done=None)
MARL/single_agent/Memory_common.py:60
↓ 3 callers
Method
act
Perform a high-level action. - If the action is a speed change, choose speed from the allowed discrete range. - Else, forwar
highway-env/highway_env/vehicle/controller.py:218
↓ 3 callers
Method
action
(self, state)
MARL/MADQN.py:166
↓ 3 callers
Method
action
(self, state)
MARL/single_agent/Agent_common.py:153
↓ 3 callers
Function
action_factory
(env: 'AbstractEnv', config: dict)
highway-env/highway_env/envs/common/action.py:226
↓ 3 callers
Method
all_side_lanes
:param lane_index: the index of a lane. :return: all lanes belonging to the same road.
highway-env/highway_env/road/road.py:140
↓ 3 callers
Method
define_spaces
Set the types and spaces of observation and action from config.
highway-env/highway_env/envs/common/abstract.py:137
↓ 3 callers
Method
display
Display a lane on a surface. :param lane: the lane to be displayed :param surface: the pygame surface
highway-env/highway_env/road/graphics.py:117
↓ 3 callers
Method
draw_stripes
Draw a set of stripes along a lane. :param lane: the lane :param surface: the surface to draw on :param starts: a li
highway-env/highway_env/road/graphics.py:187
↓ 3 callers
Function
index_to_one_hot
(index, dim)
MARL/common/utils.py:32
↓ 3 callers
Method
index_to_speed
Convert an index among allowed speeds to its corresponding speed :param index: the speed index [] :return: the corresponding
highway-env/highway_env/vehicle/controller.py:238
↓ 3 callers
Function
intervals_diff
Compute the difference of two intervals :param a: interval [a_min, a_max] :param b: interval [b_min, b_max] :return: the interval of
highway-env/highway_env/interval.py:41
↓ 3 callers
Function
neighbour_vehicles
Find the preceding and following vehicles of a given vehicle. :param vehicle: the vehicle whose neighbours must be found :param lane_ind
highway-env/highway_env/envs/common/idm_controller.py:242
↓ 3 callers
Method
observe
Get an observation of the environment state.
highway-env/highway_env/envs/common/observation.py:26
↓ 3 callers
Method
on_lane
Whether a given world position is on the lane. :param position: a world position [m] :param longitudinal: (optional) the cor
highway-env/highway_env/road/lane.py:61
↓ 3 callers
Method
parameter_box_to_polytope
(parameter_box: np.ndarray, structure: Callable)
highway-env/highway_env/vehicle/uncertainty/prediction.py:280
↓ 3 callers
Method
pos2pix
Convert two world coordinates [m] into a position in the surface [px] :param x: x world coordinate [m] :param y: y world coo
highway-env/highway_env/road/graphics.py:47
↓ 3 callers
Method
position
(self, longitudinal: float, lateral: float)
highway-env/highway_env/road/lane.py:155
↓ 3 callers
Method
release
(self)
MARL/common/utils.py:81
↓ 3 callers
Method
speed_to_index
Find the index of the closest speed allowed to a given speed. :param speed: an input speed [m/s] :return: the index of the c
highway-env/highway_env/vehicle/controller.py:250
↓ 3 callers
Method
steering_features
A collection of features used to follow a lane :param target_lane_index: index of the lane to follow :return: a array of fea
highway-env/highway_env/vehicle/behavior.py:375
↓ 3 callers
Method
train
(self)
MARL/MAPPO.py:154
↓ 2 callers
Method
__init__
(self, state_dim, hidden_size, output_size, output_act)
MARL/single_agent/Model_common.py:10
↓ 2 callers
Method
_agent_reward
The vehicle is rewarded for driving with high speed on lanes to the right and avoiding collisions But an additional altruisti
highway-env/highway_env/envs/merge_env_v1.py:63
↓ 2 callers
Function
_extract_patches
(x, kernel_size, stride, padding)
MARL/single_agent/kfac.py:16
↓ 2 callers
Method
_is_terminal
Check whether the current state is a terminal state :return:is the state terminal
highway-env/highway_env/envs/common/abstract.py:155
↓ 2 callers
Method
_soft_update_target
(self, target, source)
MARL/MAPPO.py:323
↓ 2 callers
Method
_softmax_action
(self, state, n_agents)
MARL/MAACKTR.py:183
↓ 2 callers
Method
_softmax_action
(self, state, n_agents)
MARL/MAPPO.py:202
↓ 2 callers
Method
acceleration_features
(self, ego_vehicle: ControlledVehicle, front_vehicle: Vehicle = None,
highway-env/highway_env/vehicle/behavior.py:351
↓ 2 callers
Method
action
(self, state, n_agents)
MARL/MAACKTR.py:205
↓ 2 callers
Method
action
(self, state, n_agents)
MARL/MAPPO.py:224
↓ 2 callers
Method
add_features
(self, data, lane_index, output_lane=None)
highway-env/highway_env/vehicle/behavior.py:456
↓ 2 callers
Function
agg_double_list
(l)
MARL/common/utils.py:60
↓ 2 callers
Method
blit_rotate
Many thanks to https://stackoverflow.com/a/54714144.
highway-env/highway_env/vehicle/graphics.py:85
↓ 2 callers
Method
check_collision
Check for collision with another vehicle. :param other: the other vehicle' trajectories or object other_trajectories: [vehic
highway-env/highway_env/envs/common/abstract.py:715
↓ 2 callers
Method
check_collision
Check for collision with another vehicle. :param other: the other vehicle or object
highway-env/highway_env/vehicle/kinematics.py:174
↓ 2 callers
Method
close_vehicles_to
(self, vehicle: 'kinematics.Vehicle', distance: float, count: int = None, see_behind
highway-env/highway_env/road/road.py:257
↓ 2 callers
Function
compute_ttc_grid
Compute the grid of predicted time-to-collision to each vehicle within the lane For each ego-speed and lane. :param env: environment
highway-env/highway_env/envs/common/finite_mdp.py:81
↓ 2 callers
Function
confidence_polytope
Compute a confidence polytope over the parameter theta, where y = theta^T phi :param data: a dictionary {"features": [phi_0,...,phi_N], "out
highway-env/highway_env/utils.py:145
↓ 2 callers
Method
create_from
Create a new vehicle from an existing one. Only the vehicle dynamics are copied, other properties are default. :param vehic
highway-env/highway_env/vehicle/kinematics.py:101
↓ 2 callers
Function
desired_gap
Compute the desired distance between a vehicle and its leading vehicle. :param ego_vehicle: the vehicle being controlled :param front_ve
highway-env/highway_env/envs/common/idm_controller.py:274
↓ 2 callers
Method
desired_gap
Compute the desired distance between a vehicle and its leading vehicle. :param ego_vehicle: the vehicle being controlled :pa
highway-env/highway_env/vehicle/behavior.py:141
↓ 2 callers
Method
display
Display a vehicle on a pygame surface. The vehicle is represented as a colored rotated rectangle. :param vehicle: the vehic
highway-env/highway_env/vehicle/graphics.py:28
↓ 2 callers
Method
distance
Compute the L1 distance [m] from a position to the lane.
highway-env/highway_env/road/lane.py:97
↓ 2 callers
Method
distance_to_merging_end
(self, vehicle)
highway-env/highway_env/envs/common/abstract.py:608
↓ 2 callers
Method
exploration_action
(self, state)
MARL/single_agent/Agent_common.py:149
↓ 2 callers
Method
follow_road
At the end of a lane, automatically switch to a next one.
highway-env/highway_env/vehicle/controller.py:105
↓ 2 callers
Method
front_distance_to
(self, other: "Vehicle")
highway-env/highway_env/vehicle/kinematics.py:238
↓ 2 callers
Method
get_closest_lane_index
Get the index of the lane closest to a world position. :param position: a world position [m]. :param heading: a heading angl
highway-env/highway_env/road/road.py:51
↓ 2 callers
Method
get_front_interval
(self)
highway-env/highway_env/vehicle/uncertainty/prediction.py:285
↓ 2 callers
Method
get_routes_at_intersection
Get the list of routes that can be followed at the next intersection.
highway-env/highway_env/vehicle/controller.py:153
next →
1–100 of 435, ranked by callers