Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add several accelerations to custom output #939

Merged
merged 94 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
da243f9
Add several accelerations (with/without noise, with/without failsafes…
liljonnystyle May 21, 2020
951c755
update queries with new column names
liljonnystyle May 21, 2020
df0bb66
fix flake8 issues
liljonnystyle May 21, 2020
863f360
remove trailing whitespaces
liljonnystyle May 21, 2020
87dcff2
Add several accelerations (with/without noise, with/without failsafes…
liljonnystyle May 21, 2020
d192a9f
update queries with new column names
liljonnystyle May 21, 2020
92a745d
fix flake8 issues
liljonnystyle May 21, 2020
215d4ab
remove trailing whitespaces
liljonnystyle May 21, 2020
5bb7074
Merge branch 'jl-more-accel-outputs' of https://github.com/flow-proje…
liljonnystyle May 25, 2020
97f3ccd
fix accel with noise with failsafe output
liljonnystyle May 25, 2020
3608652
get not departed vehicles (#922)
Yasharzf May 8, 2020
0a83576
Add an on ramp option
eugenevinitsky Mar 18, 2020
9b649ef
Upgrade the network to not have keepclear value on the junctions
eugenevinitsky Mar 19, 2020
c18ec58
datapip pipeline implemented
brentgryffindor Apr 6, 2020
5878eae
get up to date with i210_dev
brentgryffindor May 19, 2020
34cecff
remove dupe imports
liljonnystyle May 20, 2020
fc99836
remove blank lines after docstrings
liljonnystyle May 20, 2020
6c11a70
add back ray import
liljonnystyle May 20, 2020
d6ffaa6
remove whitespace
liljonnystyle May 20, 2020
97400c7
rebase and fix merge conflicts
liljonnystyle May 25, 2020
151e3b2
fix rebase errors
liljonnystyle May 25, 2020
9d2026e
get not departed vehicles (#922)
Yasharzf May 8, 2020
43eeee0
Add an on ramp option
eugenevinitsky Mar 18, 2020
8eed7e1
Upgrade the network to not have keepclear value on the junctions
eugenevinitsky Mar 19, 2020
c373e94
datapip pipeline implemented
brentgryffindor Apr 6, 2020
a88c209
get up to date with i210_dev
brentgryffindor May 19, 2020
89f8d1d
remove dupe imports
liljonnystyle May 20, 2020
306a01f
remove blank lines after docstrings
liljonnystyle May 20, 2020
0d5fa6b
add back ray import
liljonnystyle May 20, 2020
0ade197
remove whitespace
liljonnystyle May 20, 2020
1111e9a
moved imports under functions in train.py (#903)
chendiw Apr 21, 2020
a4c7d67
get not departed vehicles (#922)
Yasharzf May 8, 2020
36e8851
changed _departed_ids, and _arrived_ids in the update function (#926)
Yasharzf May 9, 2020
ebb2921
Add an on ramp option
eugenevinitsky Mar 18, 2020
e4c02bb
Increased inflows to 10800 to match density in Bennis ring
eugenevinitsky Mar 19, 2020
505d646
Upgrade the network to not have keepclear value on the junctions
eugenevinitsky Mar 19, 2020
7d52445
Add 1 lane highway network for Benni
eugenevinitsky Mar 25, 2020
c3b2a51
multiple runs issue solved, testing added
brentgryffindor Apr 11, 2020
dc881e0
added more support for lambda function
brentgryffindor Apr 22, 2020
ee1188e
fix windoes line ending issue with experiment.py
brentgryffindor Apr 23, 2020
65c9ee0
fix style issue
brentgryffindor Apr 23, 2020
5a3ff57
reorganized file locations
brentgryffindor Apr 23, 2020
ddc53fb
fix some more style issues
brentgryffindor Apr 23, 2020
e7ac1a9
fix one more style issue
brentgryffindor Apr 23, 2020
c970219
added new two new quries
brentgryffindor May 10, 2020
3b10524
including next_V for testing only
brentgryffindor May 11, 2020
638f9b4
change the bucket to a common bucket
brentgryffindor May 18, 2020
bc8584a
removed the old tests
brentgryffindor May 18, 2020
0ee6646
Add an on ramp option
eugenevinitsky Mar 18, 2020
3af5595
datapip pipeline implemented
brentgryffindor Apr 6, 2020
8d4ad29
multiple runs issue solved, testing added
brentgryffindor Apr 11, 2020
aa14dbf
added more support for lambda function
brentgryffindor Apr 22, 2020
00a526b
fix windoes line ending issue with experiment.py
brentgryffindor Apr 23, 2020
de35f90
fix style issue
brentgryffindor Apr 23, 2020
979d047
reorganized file locations
brentgryffindor Apr 23, 2020
fdd983e
fix some more style issues
brentgryffindor Apr 23, 2020
6af7e02
added auto upload to s3 feature for the reply scipt and fix some othe…
brentgryffindor May 19, 2020
72d4733
fix trailing white space style issue
brentgryffindor May 19, 2020
420ea3f
some minor issue fixed
brentgryffindor May 19, 2020
e45eb92
reformatting energy queries
liljonnystyle May 19, 2020
d578e63
rename vehicle power demand query
liljonnystyle May 19, 2020
32c0528
move partition condition to cte's
liljonnystyle May 19, 2020
c7cd963
fix some query string formatting issue
brentgryffindor May 19, 2020
b5be92a
fix some style issue
brentgryffindor May 19, 2020
6884960
get up to date with i210_dev
brentgryffindor May 19, 2020
7e549be
update lambda function, change partition into multi-column
brentgryffindor May 20, 2020
a799abd
remove dupe imports
liljonnystyle May 20, 2020
f4fa426
remove blank lines after docstrings
liljonnystyle May 20, 2020
2563818
add back ray import
liljonnystyle May 20, 2020
498e08a
remove whitespace
liljonnystyle May 20, 2020
d7da535
style fixed
brentgryffindor May 20, 2020
3df2312
specify power demand model names
liljonnystyle May 20, 2020
28d4f73
fix bug in vehicle power demand
liljonnystyle May 25, 2020
0779832
Add several accelerations (with/without noise, with/without failsafes…
liljonnystyle May 21, 2020
b3f15a3
update queries with new column names
liljonnystyle May 21, 2020
d66a0ab
fix flake8 issues
liljonnystyle May 21, 2020
38af177
remove trailing whitespaces
liljonnystyle May 21, 2020
fceedf8
Add several accelerations (with/without noise, with/without failsafes…
liljonnystyle May 21, 2020
df182ad
fix accel with noise with failsafe output
liljonnystyle May 25, 2020
d888405
fix rebase errors
liljonnystyle May 25, 2020
27e2960
fix merge conflicts
liljonnystyle May 26, 2020
69f6f55
rm deleted file
liljonnystyle May 26, 2020
4f2f23e
add return carriage to eof
liljonnystyle May 26, 2020
d2ba069
revert accidental change
liljonnystyle May 26, 2020
8eee772
rename trajectory table
liljonnystyle May 26, 2020
b5f5424
Merge branch 'i210_dev' into jl-more-accel-outputs
liljonnystyle May 26, 2020
3c6dcf7
added apply acceleratino function which uses setSpeed() method instea…
Yasharzf May 26, 2020
ddf6a24
added failsafe methods for max accel/decel and speed limit, and all
Yasharzf May 26, 2020
53cf035
removed json file which was added by mistake
Yasharzf May 26, 2020
b49dbce
fixed merge conflicts
Yasharzf May 26, 2020
528f0aa
fixed docstrings
Yasharzf May 26, 2020
cbf6a42
removed duplicated print
Yasharzf May 26, 2020
8645811
minor docstring formatting
liljonnystyle May 27, 2020
1669787
addressing comments
liljonnystyle May 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 90 additions & 12 deletions flow/controllers/base_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class BaseController:
delay : int
delay in applying the action (time)
fail_safe : str
Should be either "instantaneous" or "safe_velocity"
Should be "instantaneous", "safe_velocity", "feasible_accel", or "all"
noise : double
variance of the gaussian from which to sample a noisy acceleration
"""
Expand Down Expand Up @@ -75,8 +75,12 @@ def get_action(self, env):
time step.

This method also augments the controller with the desired level of
stochastic noise, and utlizes the "instantaneous" or "safe_velocity"
failsafes if requested.
stochastic noise, and utlizes the "instantaneous", "safe_velocity",
"feasible_accel", or "all" failsafes if requested. The "all" failsafe
performs all three failsafes with this order:
1) "safe_velocity",
2) "feasible_accel",
3) "instantaneous".

Parameters
----------
Expand All @@ -88,8 +92,11 @@ def get_action(self, env):
float
the modified form of the acceleration
"""
# clear the current stored accel_without_noise of this vehicle None
env.k.vehicle.update_accel_without_noise(self.veh_id, None)
# clear the current stored accel_no_noise_no_failsafe of this vehicle None
env.k.vehicle.update_accel_no_noise_no_failsafe(self.veh_id, None)
env.k.vehicle.update_accel_no_noise_with_failsafe(self.veh_id, None)
env.k.vehicle.update_accel_with_noise_no_failsafe(self.veh_id, None)
env.k.vehicle.update_accel_with_noise_with_failsafe(self.veh_id, None)

# this is to avoid abrupt decelerations when a vehicle has just entered
# a network and it's data is still not subscribed
Expand All @@ -110,23 +117,38 @@ def get_action(self, env):

# store the acceleration without noise to each vehicle
# run fail safe if requested
accel_without_noise = accel
env.k.vehicle.update_accel_no_noise_no_failsafe(self.veh_id, accel)
accel_no_noise_with_failsafe = accel
if self.fail_safe == 'instantaneous':
accel_without_noise = self.get_safe_action_instantaneous(env, accel_without_noise)
accel_no_noise_with_failsafe = self.get_safe_action_instantaneous(env, accel)
elif self.fail_safe == 'safe_velocity':
accel_without_noise = self.get_safe_velocity_action(env, accel_without_noise)
env.k.vehicle.update_accel_without_noise(self.veh_id, accel_without_noise)
accel_no_noise_with_failsafe = self.get_safe_velocity_action(env, accel)
elif self.fail_safe == 'feasible_accel':
accel_no_noise_with_failsafe = self.get_feasible_action(accel)
elif self.fail_safe == 'all':
accel_no_noise_with_failsafe = self.get_safe_velocity_action(env, accel)
accel_no_noise_with_failsafe = self.get_feasible_action(accel_no_noise_with_failsafe)
accel_no_noise_with_failsafe = self.get_safe_action_instantaneous(env, accel_no_noise_with_failsafe)

env.k.vehicle.update_accel_no_noise_with_failsafe(self.veh_id, accel_no_noise_with_failsafe)

# add noise to the accelerations, if requested
if self.accel_noise > 0:
accel += np.sqrt(env.sim_step) * np.random.normal(0, self.accel_noise)
env.k.vehicle.update_accel_with_noise_no_failsafe(self.veh_id, accel)

# run the fail-safes, if requested
if self.fail_safe == 'instantaneous':
accel = self.get_safe_action_instantaneous(env, accel)
elif self.fail_safe == 'safe_velocity':
accel = self.get_safe_velocity_action(env, accel)

elif self.fail_safe == 'feasible_accel':
accel = self.get_feasible_action(accel)
elif self.fail_safe == 'all':
accel = self.get_safe_velocity_action(env, accel)
accel = self.get_feasible_action(accel)
accel = self.get_safe_action_instantaneous(env, accel)
env.k.vehicle.update_accel_with_noise_with_failsafe(self.veh_id, accel)
return accel

def get_safe_action_instantaneous(self, env, action):
Expand Down Expand Up @@ -172,6 +194,12 @@ def get_safe_action_instantaneous(self, env, action):
# if the vehicle will crash into the vehicle ahead of it in the
# next time step (assuming the vehicle ahead of it is not
# moving), then stop immediately
print(
"=====================================\n"
"Vehicle {} is about to crash. Instantaneous acceleration "
"clipping applied.\n"
"=====================================".format(self.veh_id))

return -this_vel / sim_step
else:
# if the vehicle is not in danger of crashing, continue with
Expand Down Expand Up @@ -233,8 +261,8 @@ def safe_velocity(self, env):
Returns
-------
float
maximum safe velocity given a maximum deceleration and delay in
performing the breaking action
maximum safe velocity given a maximum deceleration, delay in
performing the breaking action, and speed limit
"""
lead_id = env.k.vehicle.get_leader(self.veh_id)
lead_vel = env.k.vehicle.get_speed(lead_id)
Expand All @@ -245,4 +273,54 @@ def safe_velocity(self, env):

v_safe = 2 * h / env.sim_step + dv - this_vel * (2 * self.delay)

# check for speed limit
this_edge = env.k.vehicle.get_edge(self.veh_id)
edge_speed_limit = env.k.network.speed_limit(this_edge)

if v_safe > edge_speed_limit:
v_safe = edge_speed_limit
print(
"=====================================\n"
"Speed of vehicle {} is greater than speed limit. Safe "
"velocity clipping applied.\n"
"=====================================".format(self.veh_id))

return v_safe

def get_feasible_action(self, action):
"""Perform the "feasible_accel" failsafe action.

Checks if the computed acceleration would put us above maximum
acceleration or deceleration. If it would, output the acceleration
equal to maximum acceleration or deceleration.

Parameters
----------
action : float
requested acceleration action

Returns
-------
float
the requested action clipped by the feasible acceleration or
deceleration.
"""
if action > self.max_accel:
action = self.max_accel

print(
"=====================================\n"
"Acceleration of vehicle {} is greater than the max "
"acceleration. Feasible acceleration clipping applied.\n"
"=====================================".format(self.veh_id))

if action < -self.max_deaccel:
action = -self.max_deaccel

print(
"=====================================\n"
"Deceleration of vehicle {} is greater than the max "
"deceleration. Feasible acceleration clipping applied.\n"
"=====================================".format(self.veh_id))

return action
49 changes: 45 additions & 4 deletions flow/core/kernel/vehicle/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,23 @@ def remove(self, veh_id):
def apply_acceleration(self, veh_id, acc):
"""Apply the acceleration requested by a vehicle in the simulator.

In SUMO, this function applies slowDown method which applies smoothing.

Parameters
----------
veh_id : str or list of str
list of vehicle identifiers
acc : float or array_like
requested accelerations from the vehicles
"""
raise NotImplementedError

def apply_acceleration_not_smooth(self, veh_id, acc):
"""Apply the acceleration requested by a vehicle in the simulator.

In SUMO, this function applies setSpeed method which doesn't apply
smoothing.

Parameters
----------
veh_id : str or list of str
Expand Down Expand Up @@ -693,16 +710,40 @@ def get_accel(self, veh_id):
"""Return the acceleration of vehicle with veh_id."""
raise NotImplementedError

def update_accel_without_noise(self, veh_id, accel_without_noise):
"""Update stored acceleration without noise of vehicle with veh_id."""
def update_accel_no_noise_no_failsafe(self, veh_id, accel_no_noise_no_failsafe):
"""Update stored acceleration without noise without failsafe of vehicle with veh_id."""
raise NotImplementedError

def update_accel_no_noise_with_failsafe(self, veh_id, accel_no_noise_with_failsafe):
"""Update stored acceleration without noise with failsafe of vehicle with veh_id."""
raise NotImplementedError

def update_accel_with_noise_no_failsafe(self, veh_id, accel_with_noise_no_failsafe):
"""Update stored acceleration with noise without failsafe of vehicle with veh_id."""
raise NotImplementedError

def update_accel_with_noise_with_failsafe(self, veh_id, accel_with_noise_with_failsafe):
"""Update stored acceleration with noise with failsafe of vehicle with veh_id."""
raise NotImplementedError

def get_2d_position(self, veh_id, error=-1001):
"""Return (x, y) position of vehicle with veh_id."""
raise NotImplementedError

def get_accel_without_noise(self, veh_id):
"""Return the acceleration without noise of vehicle with veh_id."""
def get_accel_no_noise_no_failsafe(self, veh_id):
"""Return the acceleration without noise without failsafe of vehicle with veh_id."""
raise NotImplementedError

def get_accel_no_noise_with_failsafe(self, veh_id):
"""Return the acceleration without noise with failsafe of vehicle with veh_id."""
raise NotImplementedError

def get_accel_with_noise_no_failsafe(self, veh_id):
"""Return the acceleration with noise without failsafe of vehicle with veh_id."""
raise NotImplementedError

def get_accel_with_noise_with_failsafe(self, veh_id):
"""Return the acceleration with noise with failsafe of vehicle with veh_id."""
raise NotImplementedError

def get_realized_accel(self, veh_id):
Expand Down
61 changes: 54 additions & 7 deletions flow/core/kernel/vehicle/traci.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def initialize(self, vehicles):
self.__vehicles[veh_id] = dict()
self.__vehicles[veh_id]['type'] = typ['veh_id']
self.__vehicles[veh_id]['initial_speed'] = typ['initial_speed']
self.__vehicles[veh_id]["accel_without_noise"] = None
self.__vehicles[veh_id]["accel_no_noise_no_failsafe"] = None
self.__vehicles[veh_id]["accel_no_noise_with_failsafe"] = None
self.__vehicles[veh_id]["accel_with_noise_no_failsafe"] = None
self.__vehicles[veh_id]["accel_with_noise_with_failsafe"] = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is a key existence check in all the get methods below. There is no need to initialize them here.

self.num_vehicles += 1
if typ['acceleration_controller'][0] == RLController:
self.num_rl_vehicles += 1
Expand Down Expand Up @@ -964,6 +967,20 @@ def apply_acceleration(self, veh_ids, acc):
next_vel = max([this_vel + acc[i] * self.sim_step, 0])
self.kernel_api.vehicle.slowDown(vid, next_vel, 1e-3)

def apply_acceleration_not_smooth(self, veh_ids, acc):
"""See parent class."""
# to hand the case of a single vehicle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: to handle

if type(veh_ids) == str:
veh_ids = [veh_ids]
acc = [acc]

for i, vid in enumerate(veh_ids):
if acc[i] is not None and vid in self.get_ids():
self.__vehicles[vid]["accel"] = acc[i]
this_vel = self.get_speed(vid)
next_vel = max([this_vel + acc[i] * self.sim_step, 0])
self.kernel_api.vehicle.setSpeed(vid, next_vel)
Comment on lines +973 to +978
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this different than the normal method?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the normal method uses slowDown() method which applies some sort of smoothing. here setSpeed() method is used which doesn't apply smoothing.


def apply_lane_change(self, veh_ids, direction):
"""See parent class."""
# to hand the case of a single vehicle
Expand Down Expand Up @@ -1130,15 +1147,45 @@ def get_accel(self, veh_id):
self.__vehicles[veh_id]["accel"] = None
return self.__vehicles[veh_id]["accel"]

def update_accel_without_noise(self, veh_id, accel_without_noise):
def update_accel_no_noise_no_failsafe(self, veh_id, accel_no_noise_no_failsafe):
"""See parent class."""
self.__vehicles[veh_id]["accel_no_noise_no_failsafe"] = accel_no_noise_no_failsafe

def update_accel_no_noise_with_failsafe(self, veh_id, accel_no_noise_with_failsafe):
"""See parent class."""
self.__vehicles[veh_id]["accel_no_noise_with_failsafe"] = accel_no_noise_with_failsafe

def update_accel_with_noise_no_failsafe(self, veh_id, accel_with_noise_no_failsafe):
"""See parent class."""
self.__vehicles[veh_id]["accel_with_noise_no_failsafe"] = accel_with_noise_no_failsafe

def update_accel_with_noise_with_failsafe(self, veh_id, accel_with_noise_with_failsafe):
"""See parent class."""
self.__vehicles[veh_id]["accel_with_noise_with_failsafe"] = accel_with_noise_with_failsafe

def get_accel_no_noise_no_failsafe(self, veh_id):
"""See parent class."""
if "accel_no_noise_no_failsafe" not in self.__vehicles[veh_id]:
self.__vehicles[veh_id]["accel_no_noise_no_failsafe"] = None
return self.__vehicles[veh_id]["accel_no_noise_no_failsafe"]

def get_accel_no_noise_with_failsafe(self, veh_id):
"""See parent class."""
if "accel_no_noise_with_failsafe" not in self.__vehicles[veh_id]:
self.__vehicles[veh_id]["accel_no_noise_with_failsafe"] = None
return self.__vehicles[veh_id]["accel_no_noise_with_failsafe"]

def get_accel_with_noise_no_failsafe(self, veh_id):
"""See parent class."""
self.__vehicles[veh_id]["accel_without_noise"] = accel_without_noise
if "accel_with_noise_no_failsafe" not in self.__vehicles[veh_id]:
self.__vehicles[veh_id]["accel_with_noise_no_failsafe"] = None
return self.__vehicles[veh_id]["accel_with_noise_no_failsafe"]

def get_accel_without_noise(self, veh_id):
def get_accel_with_noise_with_failsafe(self, veh_id):
"""See parent class."""
if "accel_without_noise" not in self.__vehicles[veh_id]:
self.__vehicles[veh_id]["accel_without_noise"] = None
return self.__vehicles[veh_id]["accel_without_noise"]
if "accel_with_noise_with_failsafe" not in self.__vehicles[veh_id]:
self.__vehicles[veh_id]["accel_with_noise_with_failsafe"] = None
return self.__vehicles[veh_id]["accel_with_noise_with_failsafe"]

def get_realized_accel(self, veh_id):
"""See parent class."""
Expand Down
11 changes: 8 additions & 3 deletions flow/data_pipeline/data_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,18 @@ def get_extra_info(veh_kernel, extra_info, veh_ids):
extra_info["time_step"].append(veh_kernel.get_timestep(vid) / 1000)
extra_info["id"].append(vid)
extra_info["headway"].append(veh_kernel.get_headway(vid))
extra_info["acceleration"].append(veh_kernel.get_accel(vid))
extra_info["target_accel_with_noise_with_failsafe"].append(veh_kernel.get_accel(vid))
extra_info["leader_id"].append(veh_kernel.get_leader(vid))
extra_info["follower_id"].append(veh_kernel.get_follower(vid))
extra_info["leader_rel_speed"].append(veh_kernel.get_speed(
veh_kernel.get_leader(vid)) - veh_kernel.get_speed(vid))
extra_info["accel_without_noise"].append(veh_kernel.get_accel_without_noise(vid))
extra_info["realilzed_accel"].append(veh_kernel.get_realized_accel(vid))
extra_info["target_accel_no_noise_no_failsafe"].append(
veh_kernel.get_accel_no_noise_no_failsafe(vid))
extra_info["target_accel_with_noise_no_failsafe"].append(
veh_kernel.get_accel_with_noise_no_failsafe(vid))
extra_info["target_accel_no_noise_with_failsafe"].append(
veh_kernel.get_accel_no_noise_with_failsafe(vid))
extra_info["realized_accel"].append(veh_kernel.get_realized_accel(vid))
extra_info["road_grade"].append(veh_kernel.get_road_grade(vid))
position = veh_kernel.get_2d_position(vid)
extra_info["x"].append(position[0])
Expand Down
10 changes: 5 additions & 5 deletions flow/data_pipeline/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class QueryStrings(Enum):
id,
time_step,
speed,
acceleration,
target_accel_with_noise_with_failsafe AS acceleration,
road_grade,
source_id
FROM trajectory_table
Expand All @@ -71,7 +71,7 @@ class QueryStrings(Enum):
id,
time_step,
speed,
accel_without_noise AS acceleration,
target_accel_no_noise_with_failsafe AS acceleration,
road_grade,
source_id
FROM trajectory_table
Expand All @@ -88,7 +88,7 @@ class QueryStrings(Enum):
SELECT
id,
time_step,
accel_without_noise,
target_accel_no_noise_with_failsafe,
road_grade,
source_id,
time_step - LAG(time_step, 1)
Expand All @@ -103,8 +103,8 @@ class QueryStrings(Enum):
SELECT
id,
time_step,
prev_speed + accel_without_noise * sim_step AS speed,
accel_without_noise AS acceleration,
prev_speed + target_accel_no_noise_with_failsafe * sim_step AS speed,
target_accel_no_noise_with_failsafe AS acceleration,
road_grade,
source_id
FROM lagged_timestep
Expand Down