Echtzeitsysteme / gips

Graph-Based (M)ILP Problem Specification Tool
https://gips.dev
GNU General Public License v3.0
3 stars 1 forks source link

Boolean variables in mappings lead to non-compilable code #132

Closed maxkratz closed 1 week ago

maxkratz commented 10 months ago

Related test case: https://github.com/Echtzeitsysteme/gips-tests/blob/feature/add-var-boolean-bug-test-case/gipsl.all.build.varsbooleanbug/src/gipsl/all/build/varsbooleanbug/Model.gipsl

mapping n2n with mapVnode {
    var b : EBoolean
};

^this creates non-compilable code in N2nMapping.java:

Description Resource Path Location Type The method round(float) in the type Math is not applicable for the arguments (boolean) N2nMapping.java /gipsl.all.build.varsbooleanbug/src-gen/gipsl/all/build/varsbooleanbug/api/gips/mapping line 112 Java Problem The method setValue(Integer) in the type ILPBinaryVariable is not applicable for the arguments (boolean) N2nMapping.java /gipsl.all.build.varsbooleanbug/src-gen/gipsl/all/build/varsbooleanbug/api/gips/mapping line 60 Java Problem Type mismatch: cannot convert from Integer to boolean N2nMapping.java /gipsl.all.build.varsbooleanbug/src-gen/gipsl/all/build/varsbooleanbug/api/gips/mapping line 56 Java Problem

maxkratz commented 1 week ago

The linked PR also fixes this bug for bound boolean variables.