Commit e283223e authored by lafabregue's avatar lafabregue

minor changes

parent 9cb71b1c
......@@ -976,6 +976,7 @@ public class SimpleData extends Data {
this.dataObjects = data.getViewDataObjects();
this.iter = mask.getIncludedIndexes();
if (dataObjects.size() != mask.getOverallCarinality()) {
throw new IndexOutOfBoundsException("The size of the mask does not match the size of the data to read ");
}
......
......@@ -974,7 +974,7 @@ public class ClusteringEvaluation {
// we ignore if the constraints can't be evaluated (negative value)
if (qualityValue >= 0) {
totalWeight += data.getConstraintWeight(i);
qualityValue += data.getConstraints().get(i).evaluate(clusteringResult);
qualityValue += constraints.get(i).evaluate(clusteringResult);
}
}
}
......
......@@ -1617,6 +1617,16 @@ public class HybridClassification extends Classification implements Runnable, It
this.setChanged();
this.notifyObservers(HybridClassification.VIEW_AGENTS);
this.conflictsLeft = -1;
//<< start test
try {
PrintWriter writer = new PrintWriter("log_samarah"+this.getName()+".log");
writer.print("");
writer.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
//>> end test
// lancement du calcul
while (!this.stop) {
......
......@@ -234,12 +234,22 @@ public class SamarahConflict {
}
for (MustLinkConstraint mlc : involvedMLa1_unsat) {
out.println("ml " + mlc.toString() + " : unsat constraint for a"+this.agent1.getId()+" -> split " + this.classe);
int firstLabel = ag1.getClassification().getClusteringResult().getClusterMap()[mlc.getFirstIndex()];
int secondLabel = ag1.getClassification().getClusteringResult().getClusterMap()[mlc.getSecondIndex()];
if (firstLabel == secondLabel) {
out.println("now satisified");
}
}
for (CannotLinkConstraint clc : involvedCLa1_sat) {
out.println("cl " + clc.toString() + " : sat constraint for a"+this.agent1.getId()+" -> split " + this.classe);
}
for (CannotLinkConstraint clc : involvedCLa1_unsat) {
out.println("cl " + clc.toString() + " : unsat constraint for a"+this.agent1.getId()+" -> split " + this.classe);
int firstLabel = ag1.getClassification().getClusteringResult().getClusterMap()[clc.getFirstIndex()];
int secondLabel = ag1.getClassification().getClusteringResult().getClusterMap()[clc.getSecondIndex()];
if (firstLabel != secondLabel) {
out.println("now satisified");
}
}
for (MustLinkConstraint mlc : involvedMLa2_sat) {
......@@ -247,12 +257,22 @@ public class SamarahConflict {
}
for (MustLinkConstraint mlc : involvedMLa2_unsat) {
out.println("ml " + mlc.toString() + " : unsat constraint for a"+this.agent2.getId()+" -> merge " + cr_toString);
int firstLabel = ag2.getClassification().getClusteringResult().getClusterMap()[mlc.getFirstIndex()];
int secondLabel = ag2.getClassification().getClusteringResult().getClusterMap()[mlc.getSecondIndex()];
if (firstLabel == secondLabel) {
out.println("now satisified");
}
}
for (CannotLinkConstraint clc : involvedCLa2_sat) {
out.println("cl " + clc.toString() + " : sat constraint for a"+this.agent2.getId()+" -> merge " + cr_toString);
}
for (CannotLinkConstraint clc : involvedCLa2_unsat) {
out.println("cl " + clc.toString() + " : unsat constraint for a"+this.agent2.getId()+" -> merge " + cr_toString);
int firstLabel = ag2.getClassification().getClusteringResult().getClusterMap()[clc.getFirstIndex()];
int secondLabel = ag2.getClassification().getClusteringResult().getClusterMap()[clc.getSecondIndex()];
if (firstLabel != secondLabel) {
out.println("now satisified");
}
}
//>>> test - end
} else {
......@@ -266,12 +286,22 @@ public class SamarahConflict {
}
for (MustLinkConstraint mlc : involvedMLa1_unsat) {
out.println("ml " + mlc.toString() + " : unsat constraint for a"+this.agent1.getId()+" -> delete " + this.classe);
int firstLabel = ag1.getClassification().getClusteringResult().getClusterMap()[mlc.getFirstIndex()];
int secondLabel = ag1.getClassification().getClusteringResult().getClusterMap()[mlc.getSecondIndex()];
if (firstLabel != secondLabel) {
out.println("now satisified");
}
}
for (CannotLinkConstraint clc : involvedCLa1_sat) {
out.println("cl " + clc.toString() + " : sat constraint for a"+this.agent1.getId()+" -> delete " + this.classe);
}
for (CannotLinkConstraint clc : involvedCLa1_unsat) {
out.println("cl " + clc.toString() + " : unsat constraint for a"+this.agent1.getId()+" -> delete " + this.classe);
int firstLabel = ag1.getClassification().getClusteringResult().getClusterMap()[clc.getFirstIndex()];
int secondLabel = ag1.getClassification().getClusteringResult().getClusterMap()[clc.getSecondIndex()];
if (firstLabel != secondLabel) {
out.println("now satisified");
}
}
//>>> test - end
}
......
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