Conversation
| // initCount += 100; | ||
| // } | ||
| transferPoints.add(node); | ||
| //createStation(node, initCount, counter++); |
There was a problem hiding this comment.
don't forget to remove all these comments
| maxDelayTime = config.ridesharing.maxProlongationInSeconds * 1000; | ||
| this.config = config; | ||
|
|
||
| // // max distance in meters between vehicle and request for the vehicle to be considered to serve the request |
There was a problem hiding this comment.
Why have you replaced the values from config with some hardcoded ones?
| this.requestFactory = requestFactory; | ||
|
|
||
| //TODO: | ||
| // commented because config is null in test |
There was a problem hiding this comment.
You should make it work both with tests and integrated into the simulation. You can provide config in tests too.
| for (int i = 0; i < taxisCount; i++) { | ||
| RideSharingOnDemandVehicle taxi = taxis.get(i); | ||
| SimulationNode taxiPosition = taxis.get(i).getPosition(); | ||
| Set<PlanComputationRequest> requestsOnBoardSet = new HashSet<>(); |
There was a problem hiding this comment.
Why are you using a set here??
| } | ||
| List<PlanAction> bestPlan = findItineraryWithMinimumDelay(lst); | ||
| return bestPlan; | ||
| } |
There was a problem hiding this comment.
This function seems to be like IH for one vehicle, but extremely inefficient. I guess later you can achieve huge improvements here.
| * @return | ||
| */ | ||
| // private List<RequestPlan> heuristics(List<RideSharingOnDemandVehicle> taxis, List<PlanComputationRequest> requests) { | ||
| private List<RideSharingOnDemandVehicle> heuristics(List<RideSharingOnDemandVehicle> taxis, List<PlanComputationRequest> requests) { |
There was a problem hiding this comment.
Too long method. It should be decomposed almost certainly. I haven't seen any pseudocode remotely close to this in the article :)
| for (int i = 0; i < planOfCar.size(); i++) { | ||
| PlanAction action = planOfCar.get(i); | ||
| if (action instanceof PlanRequestAction) { | ||
| PlanComputationRequest pcq = ((PlanRequestAction) action).getRequest(); | ||
| previousPosition = action.getPosition(); | ||
| if (pcq == request) { | ||
| index = i; | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| //find last action | ||
| for (int i = planOfCar.size()-1; i > 0; i--) { | ||
| PlanAction action = planOfCar.get(i); | ||
| if (action instanceof PlanRequestAction) { | ||
| PlanComputationRequest pcq = ((PlanRequestAction) action).getRequest(); | ||
| previousPosition = action.getPosition(); | ||
| if (pcq == request) { | ||
| lastAction = action; | ||
| break; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
you should not need a for loop to find first/last action
| return bestPlan; | ||
| } | ||
|
|
||
| private List<PlanAction> getActionsForRequestFromActionsForDriver(List<PlanAction> planActionsVehicle, PlanComputationRequest request, RideSharingOnDemandVehicle vehicle) { |
There was a problem hiding this comment.
Again, seems overly complex for the task
| @@ -29,12 +34,16 @@ | |||
| * @author F.I.D.O. | |||
| */ | |||
| public class DriverPlan implements Iterable<PlanAction>{ | |||
There was a problem hiding this comment.
This class should not be used for plan creation, it is an output class for the simulation. Create your own data structures for this instead.
| amodsim_data_dir: '/Users/adela/Documents/bakalarka/test_simod/data/' | ||
|
|
||
| # experiment specific data (cache, results,...) | ||
| amodsim_experiment_dir: "FILL THIS WITH PATH TO EXPERIMENT DIR" | ||
| amodsim_experiment_dir: "/Users/adela/Documents/bakalarka/test_simod/" | ||
|
|
There was a problem hiding this comment.
Wrong, put this to your local config!
No description provided.