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

lane snap back commented out #12

Closed
zsunberg opened this issue May 7, 2016 · 5 comments
Closed

lane snap back commented out #12

zsunberg opened this issue May 7, 2016 · 5 comments

Comments

@zsunberg
Copy link
Member

zsunberg commented May 7, 2016

Hey Chris, I noticed that you had the code that stops the car when it gets to the middle of a lane commented out. Was it not working or producing some sort of bad side effect?

@cho3
Copy link
Collaborator

cho3 commented May 9, 2016

yeah I commented it out because it looks like it causes cars to not be able to lane change. If I don't comment it out, then cars will have the intention to lanechange, but I think the snapback causes them to not actually be able to do it. We should hash out what's going on and what it's supposed to do in more detail when we get the chance.

@cho3
Copy link
Collaborator

cho3 commented May 9, 2016

Example:

nb_lanes = 4
pp = PhysicalParam(nb_lanes,lane_length=100.)
_discount = 1.
nb_cars=10

rmodel = NoCrashRewardModel()

dmodel = NoCrashIDMMOBILModel(nb_cars, pp)

mdp = NoCrashMDP(dmodel, rmodel, _discount);

rng = MersenneTwister(5)

s = Multilane.MLState(false,[Multilane.CarState(50.0,3.0,27.0,0.0,Nullable{Multilane.BehaviorModel}(),1),Multilane.CarState(59.905098426169985,1.0,27.495354856644603,0.0,Nullable(Multilane.IDMMOBILBehavior(Multilane.IDMParam(2.0,2.0,0.8,27.5,4.0,4.0),Multilane.MOBILParam(0.0,4.0,0.2),1.0,3)),2),Multilane.CarState(16.6617190807235,1.0,27.307205060490016,0.6666666666666666,Nullable(Multilane.IDMMOBILBehavior(Multilane.IDMParam(2.0,2.0,0.8,31.0,4.0,4.0),Multilane.MOBILParam(0.0,4.0,0.2),1.0,6)),3),Multilane.CarState(66.6281925481095,4.0,32.4068374874881,0.0,Nullable(Multilane.IDMMOBILBehavior(Multilane.IDMParam(1.5,1.5,1.4,35.0,4.0,4.0),Multilane.MOBILParam(0.25,4.0,0.2),1.0,8)),6),Multilane.CarState(0.3254588302155135,3.0,27.0,0.0,Nullable(Multilane.IDMMOBILBehavior(Multilane.IDMParam(1.5,1.5,1.4,35.0,4.0,4.0),Multilane.MOBILParam(0.25,4.0,0.2),1.0,8)),7)])

a = Multilane.MLAction(-1.0,-0.6666666666666666)

sp = Multilane.MLState(false,[Multilane.CarState(50.0,3.0,27.0,-0.6666666666666666,Nullable{Multilane.BehaviorModel}(),1),Multilane.CarState(60.557864388240844,1.0,27.495354375544366,0.0,Nullable(Multilane.IDMMOBILBehavior(Multilane.IDMParam(2.0,2.0,0.8,27.5,4.0,4.0),Multilane.MOBILParam(0.0,4.0,0.2),1.0,3)),2),Multilane.CarState(17.176857028673684,1.0,27.31649613404381,0.6666666666666666,Nullable(Multilane.IDMMOBILBehavior(Multilane.IDMParam(2.0,2.0,0.8,31.0,4.0,4.0),Multilane.MOBILParam(0.0,4.0,0.2),1.0,6)),3),Multilane.CarState(71.07534849813908,4.0,32.70224504592412,0.0,Nullable(Multilane.IDMMOBILBehavior(Multilane.IDMParam(1.5,1.5,1.4,35.0,4.0,4.0),Multilane.MOBILParam(0.25,4.0,0.2),1.0,8)),6),Multilane.CarState(0.5258422370435767,3.0,27.0,-0.6666666666666666,Nullable(Multilane.IDMMOBILBehavior(Multilane.IDMParam(1.5,1.5,1.4,35.0,4.0,4.0),Multilane.MOBILParam(0.25,4.0,0.2),1.0,8)),7),Multilane.CarState(100.0,3.0,27.0,0.0,Nullable(Multilane.IDMMOBILBehavior(Multilane.IDMParam(1.5,1.5,1.4,35.0,4.0,4.0),Multilane.MOBILParam(0.25,4.0,0.2),1.0,8)),8)])

@cho3
Copy link
Collaborator

cho3 commented May 9, 2016

also when lanesnapback is commented out, there is some weird dithering behavior for some of the cars in the environment (go back and forth with half lane changes)

@zsunberg
Copy link
Member Author

zsunberg commented May 9, 2016

Fixed the snapping back. Don't know about the weird dithering

@cho3
Copy link
Collaborator

cho3 commented May 9, 2016

cool beans it works. Moving dithering to a new issue: #16

@cho3 cho3 closed this as completed May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants