Commit 1e37a19d authored by Simone Vuotto's avatar Simone Vuotto

Add numeric I/O list of variables in LTLDcSpec

parent 196dfb78
Pipeline #196 passed with stages
in 1 minute and 50 seconds
......@@ -13,8 +13,16 @@ public class LTLDcSpec extends LTLSpec {
/** The range map. */
private Map<String, TreeMap<Float, Atom[]>> rangeMap;
/** Set of Input variables **/
private final Set<String> numericInputVariables;
/** Set of Output variables */
private final Set<String> numericOutputVariables;
public LTLDcSpec(List<? extends Requirement> requirements) {
computeRangeMap(requirements);
numericInputVariables = new HashSet<>();
numericOutputVariables = new HashSet<>();
}
public Map<String, TreeMap<Float, Atom[]>> getRangeMap() {
......@@ -157,4 +165,19 @@ public class LTLDcSpec extends LTLSpec {
rangeMap = rangeMapVisitor.getRangeMap();
}
public Set<String> getNumericInputVariables() {
return numericInputVariables;
}
public Set<String> getNumericOutputVariables() {
return numericOutputVariables;
}
public void addNumericInputVariable(String var) {
this.numericInputVariables.add(var);
}
public void addNumericOutputVariable(String var) {
this.numericOutputVariables.add(var);
}
}
......@@ -163,6 +163,19 @@ public class PSP2LTL implements ExpressionVisitor {
if(exp.isOutput()) {
spec.addOututVariable(a);
}
} else {
for(Atom[] atoms: spec.getRangeMap().get(exp.getLabel()).values()) {
if(exp.isInput()) {
spec.addNumericInputVariable(exp.getLabel());
spec.addInputVariable(atoms[0]);
spec.addInputVariable(atoms[1]);
}
if(exp.isOutput()) {
spec.addNumericOutputVariable(exp.getLabel());
spec.addOututVariable(atoms[0]);
spec.addOututVariable(atoms[1]);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment