Skip to content

Commit

Permalink
we didn't observe multiple switching because we require to stay in mo…
Browse files Browse the repository at this point in the history
…de for certain amount of time
  • Loading branch information
lyg1597 committed Feb 27, 2024
1 parent cb7f5b4 commit 103d4cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sense.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def sense(self, agent: BaseAgent, state_dict, lane_map):

print(cont['ego.s'])

if(cont['ego.s'] == [0,1]):
if(cont['ego.s'] == [0,1] and cont['ego.t'][1]>2):
print("hello")

return cont, disc, len_dict
Expand Down
4 changes: 2 additions & 2 deletions sensedl.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def __init__(self, x, y, theta, v,t, agent_mode: AgentMode, track_mode: TrackMod
def decisionLogic(ego: State, track_map):
output = copy.deepcopy(ego)

if ego.s == 0 and ego.t >= 2: #we're on the left side
if ego.s == 0 and ego.t >= 1: #we're on the left side
output.agent_mode = AgentMode.Right #go right
output.t = 0
elif ego.s == 1 and ego.t >= 2: #we're on the right side
if ego.s == 1 and ego.t >= 1: #we're on the right side
output.agent_mode = AgentMode.Left #go left
output.t = 0
'''
Expand Down

0 comments on commit 103d4cc

Please sign in to comment.