Skip to content

Commit

Permalink
Course Timetabling Solver: Passivation
Browse files Browse the repository at this point in the history
- ensure that a passivated solver retains its initial and best solutions
  • Loading branch information
tomas-muller committed Oct 9, 2023
1 parent a5e3be6 commit 5841952
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions JavaSource/org/unitime/timetable/solver/TimetableSolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,18 @@ protected TimetableModel createModel(DataProperties properties) {

@Override
protected Document createCurrentSolutionBackup(boolean anonymize, boolean idconv) {

if (anonymize) {
getProperties().setProperty("Xml.ConvertIds", idconv ? "true" : "false");
getProperties().setProperty("Xml.ShowNames", "false");
getProperties().setProperty("Xml.SaveInitial", "false");
getProperties().setProperty("Xml.SaveBest", "false");
getProperties().setProperty("Xml.SaveSolution", "true");
} else {
getProperties().setProperty("Xml.ShowNames", "true");
getProperties().setProperty("Xml.ConvertIds", "false");
getProperties().setProperty("Xml.SaveInitial", "true");
getProperties().setProperty("Xml.SaveBest", "true");
getProperties().setProperty("Xml.SaveSolution", "true");
}

TimetableXMLSaver saver = new TimetableXMLSaver(this);
Expand All @@ -182,11 +190,6 @@ protected Document createCurrentSolutionBackup(boolean anonymize, boolean idconv
cbsInfo.save(document.getRootElement().addElement("cbsInfo"));
}

if (anonymize) {
getProperties().setProperty("Xml.ConvertIds", "false");
getProperties().setProperty("Xml.ShowNames", "true");
}

return document;
}

Expand Down

0 comments on commit 5841952

Please sign in to comment.