-
Notifications
You must be signed in to change notification settings - Fork 26
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
Don't get TSP example why there are update to cost/distance? #13
Comments
after more time spent on reading code, i got the idea of update is to use the streaming data source to add new cities or change connected/non-connected state between cities dynamically? but still i can't connect the dots: |
for adding new cities, besides adding into numberOfCities, also to call setNumberOfVariables to increase variables number? but is it feasible to add change variables in running state? |
JMealSP only allows updating the distance matrix or the cost matrix, it is not possible to add more cities during the running time. The idea in the problem design is that due to different causes (traffic issues, accidents, etc) the values of both matrices can change. Then those changes must be reflected in the algorithm performance and data. However, the problem can be updated for allowing modifying the number of cities during the running time. Still, you need to consider that you need to include new matrices and ensure that they change the correct one and inside their boundaries. The number of variables is set when the algorithm starts its execution and cannot be modified |
I tried to write a problem myself by referring to TSP as it is easier to understand, but don't get what this function is for.
To me distance/cost is fixed to TSP problem, only variables for permutation to change as solution to evaluate the by 2 object, this update function is called for what reason and when?
jmetalsp-problem\src\main\java\org\uma\jmetalsp\problem\tsp\DynamicMultiobjectiveTSP.java
@OverRide
public void update(Observable<ObservedValue> observable, ObservedValue data) {
if (data!=null && data.getValue().getMatrixIdentifier() == "COST") {
updateCostValue(data.getValue().getX(),data.getValue().getY(),data.getValue().getValue());
} else if(data!=null && data.getValue().getMatrixIdentifier() == "VALUE"){
updateDistanceValue(data.getValue().getX(),data.getValue().getY(),data.getValue().getValue());
}
}
The text was updated successfully, but these errors were encountered: