Element softConstraintsPenaltyElement = new Element("SoftConstraintsPenalty");
softConstraintsPenaltyElement.setText(Integer.toString(nurseRoster.getScore().getSoftScore()));
solutionElement.addContent(softConstraintsPenaltyElement);
for (Assignment assignment : nurseRoster.getAssignmentList()) {
Shift shift = assignment.getShift();
if (shift != null) {
Element assignmentElement = new Element("Assignment");
solutionElement.addContent(assignmentElement);
Element dateElement = new Element("Date");
dateElement.setText(shift.getShiftDate().getDateString());
assignmentElement.addContent(dateElement);
Element employeeElement = new Element("Employee");
employeeElement.setText(assignment.getEmployee().getCode());
assignmentElement.addContent(employeeElement);
Element shiftTypeElement = new Element("ShiftType");
shiftTypeElement.setText(shift.getShiftType().getCode());
assignmentElement.addContent(shiftTypeElement);
}
}
}