jMetalSP icon indicating copy to clipboard operation
jMetalSP copied to clipboard

Don't get TSP example "numberOfViolatedConstraints.setAttribute(solution,nonConnectedLinks-numberOfCities+9)"

Open bronzels opened this issue 4 years ago • 0 comments

I tried to write a problem myself by referring to TSP as it is easier to understand, but don't get this line.

To me nonConnectedLinks is just the number of violations to constraint(non connected city are set next to each other), why add "-numberOfCities+9"?

jmetalsp-problem\src\main\java\org\uma\jmetalsp\problem\tsp\DynamicMultiobjectiveTSP.java

numberOfViolatedConstraints.setAttribute(solution,nonConnectedLinks-numberOfCities+9);

bronzels avatar Jun 19 '21 03:06 bronzels