Closed agrignard closed 4 years ago
ca viendrait pas ce commit par hasard? https://github.com/agrignard/ReChamp/commit/3b16fbf3e1ed95ae0851606026e04e842c41c000
Ca marchait hier
car 645 origin: {486.1107737827115,982.7025999240577,0.0} [intersection(1423)] dest: intersection(296) [intersection(1423),intersection(296)] nil
BOn on essaie de tester comme il faut avant de commiter, ca me pette à al geule quand je change d'état....
2 occurrences in 2 agents at cycle 428: Java error: nil value detected in current_path <- as_path(([road(current_road)]) + list(new_path.edges),driving_road_network);
NullPointerException: null
when applying the edges operator on null
in current_path <- as_path(([road(current_road)]) + list(new_path.edges),driving_road_network);
in if first(intersection where (each.location = location)) != target_intersection {
if new_path = nil {
write 'car ' + int(self) ;
write (('origin: ' + location) + ' ') + (intersection where (each.location = location)) ;
write 'dest: ' + target_intersection ;
write li ;
write old_path ;
ask world {
do pause ;
}
}
in if target_intersection in possible_targets[currentSimuState] { truc <- 1; point save_location <- location; location <- last(road(current_road).shape.points); list li <- [first(intersection where (each.location = location)),target_intersection];
path
path new_path <- self.compute_path(graph:driving_road_network, target:target_intersection);
if first(intersection where (each.location = location)) != target_intersection {
if new_path = nil {
write 'car ' + int(self) ;
write (('origin: ' + location) + ' ') + (intersection where (each.location = location)) ;
write 'dest: ' + target_intersection ;
write li ;
write old_path ;
ask world {
do pause ;
}
}else { truc <- 2; trace <+ road(current_road).to_display; road_trace <+ road(current_road); current_path <- as_path([road(current_road)],driving_road_network); final_target <- last(road(current_road).shape.points); int j <- targets index_of final_target; targets <- [final_target]; trace <+ road(current_road).to_display; road_trace <+ road(current_road); }
in else { trace <+ road(current_road).to_display; road_trace <+ road(current_road); int truc <- 0; if target_intersection in possible_targets[currentSimuState] { truc <- 1; point save_location <- location; location <- last(road(current_road).shape.points); list li <- [first(intersection where (each.location = location)),target_intersection];
path
path new_path <- self.compute_path(graph:driving_road_network, target:target_intersection);
if first(intersection where (each.location = location)) != target_intersection {
if new_path = nil {
write 'car ' + int(self) ;
write (('origin: ' + location) + ' ') + (intersection where (each.location = location)) ;
write 'dest: ' + target_intersection ;
write li ;
write old_path ;
ask world {
do pause ;
}
}
in if not(road(current_road).to_display) { fade_count <- 15; }else { trace <+ road(current_road).to_display; road_trace <+ road(current_road); int truc <- 0; if target_intersection in possible_targets[currentSimuState] { truc <- 1; point save_location <- location; location <- last(road(current_road).shape.points); list li <- [first(intersection where (each.location = location)),target_intersection];
path
path new_path <- self.compute_path(graph:driving_road_network, target:target_intersection);
if first(intersection where (each.location = location)) != target_intersection {
if new_path = nil {
write 'car ' + int(self) ;
write (('origin: ' + location) + ' ') + (intersection where (each.location = location)) ;
write 'dest: ' + target_intersection ;
write li ;
write old_path ;
ask world {
do pause ;
}
}
in if current_road != nil { trace <+ road(current_road).to_display; road_trace <+ road(current_road); if not(road(current_road).to_display) { fade_count <- 15; }else { trace <+ road(current_road).to_display; road_trace <+ road(current_road); int truc <- 0; if target_intersection in possible_targets[currentSimuState] { truc <- 1; point save_location <- location; location <- last(road(current_road).shape.points); list li <- [first(intersection where (each.location = location)),target_intersection];
path
path new_path <- self.compute_path(graph:driving_road_network, target:target_intersection);
if first(intersection where (each.location = location)) != target_intersection {
if new_path = nil {
write 'car ' + int(self) ;
write (('origin: ' + location) + ' ') + (intersection where (each.location = location)) ;
write 'dest: ' + target_intersection ;
write li ;
write old_path ;
ask world {
do pause ;
}
}
in action update { list
list
if current_road != nil {
trace <+ road(current_road).to_display;
road_trace <+ road(current_road);
if not(road(current_road).to_display) {
fade_count <- 15;
}else {
trace <+ road(current_road).to_display;
road_trace <+ road(current_road);
int truc <- 0;
if target_intersection in possible_targets[currentSimuState] {
truc <- 1;
point save_location <- location;
location <- last(road(current_road).shape.points);
list li <- [first(intersection where (each.location = location)),target_intersection];
path
path new_path <- self.compute_path(graph:driving_road_network, target:target_intersection);
if first(intersection where (each.location = location)) != target_intersection {
if new_path = nil {
write 'car ' + int(self) ;
write (('origin: ' + location) + ' ') + (intersection where (each.location = location)) ;
write 'dest: ' + target_intersection ;
write li ;
write old_path ;
ask world {
do pause ;
}
}
in do update ; in ask first(100,shuffle(car where each.to_update)) { do update ; }
in ask first(100,shuffle(car where each.to_update)) { do update ; }
in reflex update_cars { ask first(100,shuffle(car where each.to_update)) { do update ; }
}
in agents car1405, Simulation 0