newCity.setLongitude(longitude);
newCity.setLatitude(latitude);
logger.info("Scheduling insertion of newCity ({}).", newCity);
solutionBusiness.doProblemFactChange(new ProblemFactChange() {
public void doChange(ScoreDirector scoreDirector) {
TravelingSalesmanTour solution = (TravelingSalesmanTour) scoreDirector.getWorkingSolution();
scoreDirector.beforeProblemFactAdded(newCity);
solution.getCityList().add(newCity);
scoreDirector.afterProblemFactAdded(newCity);
Visit newVisit = new Visit();
newVisit.setId(newCity.getId());
newVisit.setCity(newCity);
scoreDirector.beforeEntityAdded(newVisit);
solution.getVisitList().add(newVisit);
scoreDirector.afterEntityAdded(newVisit);
}
});
updatePanel(solutionBusiness.getSolution());
}