Skip to content

Commit

Permalink
Addresses #352
Browse files Browse the repository at this point in the history
For now I'm just handling the case where the dataType variable is not defined.
But if we run headless legacy on Model 12.gaml from model library, we define the displays as 2d explicitly, so shouldn't dataType be 2d display ? And if so, what is the expected dataType in case of 3d display ?
  • Loading branch information
lesquoyb committed Oct 24, 2024
1 parent 974ec0f commit 01b9c7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gama.headless/src/gama/headless/xml/XMLWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.io.*;

import gama.headless.common.DataType;
import gama.headless.core.*;
import gama.headless.job.ExperimentJob;
import gama.headless.job.ListenedVariable;
Expand Down Expand Up @@ -66,7 +67,9 @@ public void close() {
public void writeResultStep(final long step, final ListenedVariable[] vars) {
StringBuilder sb = new StringBuilder().append("\t<Step id='").append(step).append("' >\n");
for ( int i = 0; i < vars.length; i++ ) {
sb.append("\t\t<Variable name='").append(vars[i].getName()).append("' type='").append(vars[i].getDataType().name()).append("'>").append(vars[i].getValue())
sb.append("\t\t<Variable name='").append(vars[i].getName())
.append("' type='").append((vars[i].getDataType() == null ? DataType.UNDEFINED : vars[i].getDataType()).name())
.append("'>").append(vars[i].getValue())
.append("</Variable>\n");
}
sb.append("\t</Step>\n");
Expand Down

0 comments on commit 01b9c7d

Please sign in to comment.