Commit fe44b8c5 authored by lonca's avatar lonca
Browse files

Changed CSP encoding display

git-svn-id: svn+ssh://svn.forge.ow2.org/svnroot/sat4j/maven/trunk@2545 ba638df5-4473-46d1-82f8-c3ae2a17a6e1
parent feac34bb
......@@ -100,19 +100,11 @@ public class CSPLauncher extends AbstractLauncher {
private void displayEncoding() {
if(this.reader.hasAMapping()) {
this.out.write("c CSP to SAT var mapping:");
this.out.write("c CSP to SAT var mapping:\n");
Map<Integer, String> mapping = this.reader.getMapping();
String lastVar="";
for(Map.Entry<Integer, String> entry : mapping.entrySet()) {
final String curVarAssignment = entry.getValue();
final String curVar = curVarAssignment.substring(0, curVarAssignment.indexOf("="));
if(!curVar.equals(lastVar)) {
this.out.write("\nc ");
}
this.out.write(curVarAssignment+":"+entry.getKey()+" ");
lastVar = curVar;
this.out.write(entry.getValue()+";"+entry.getKey()+"\n");
}
this.out.write("\n");
}
}
......
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