Skip to content

Commit

Permalink
git pushMerge branch 'master' of github.com:gama-platform/gama
Browse files Browse the repository at this point in the history
  • Loading branch information
RoiArthurB committed Nov 18, 2020
2 parents 5184eb9 + 5cd3848 commit 0bb5694
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions msi.gama.headless/src/msi/gama/headless/job/Parameter.java
Expand Up @@ -14,9 +14,11 @@

import msi.gama.common.interfaces.IKeyword;
import msi.gama.headless.common.DataType;
import msi.gama.kernel.model.IModel;
import msi.gama.kernel.model.IModel;
import msi.gaml.descriptions.IDescription;
import msi.gaml.expressions.BinaryOperator;
import msi.gaml.expressions.IExpression;
import msi.gaml.types.GamaFileType;
import msi.gaml.types.IType;

public class Parameter {
Expand All @@ -41,7 +43,10 @@ public static Parameter loadAndBuildParameter(final IDescription paramDesc, fina
final String name = paramDesc.getLitteral(IKeyword.NAME);
final String varName = paramDesc.getLitteral(IKeyword.VAR);
final IExpression exp = paramDesc.getFacetExpr(IKeyword.INIT);
final Object val = exp.isConst() ? exp.getConstValue() : exp.serialize(true);
Object val = exp.isConst() ? exp.getConstValue() : exp.serialize(true);
if(exp.getGamlType().getParent() instanceof GamaFileType) {
val=((BinaryOperator)exp).arg(0);
}
final Parameter res = new Parameter(name, varName, val, translate(paramDesc.getGamlType().id()));
return res;
}
Expand Down

0 comments on commit 0bb5694

Please sign in to comment.