fixed solution selection bug (introduced in previous commit)
This commit is contained in:
parent
e747c5c348
commit
22b0d83d36
|
@ -471,6 +471,8 @@ class ClusterSolver(Notifier):
|
||||||
|
|
||||||
def _add_method_complete(self, merge):
|
def _add_method_complete(self, merge):
|
||||||
diag_print("add_method_complete "+str(merge), "clsolver")
|
diag_print("add_method_complete "+str(merge), "clsolver")
|
||||||
|
|
||||||
|
# do not add if method is redundant
|
||||||
if self._is_redundant_method(merge):
|
if self._is_redundant_method(merge):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -495,6 +497,9 @@ class ClusterSolver(Notifier):
|
||||||
overconstrained = overconstrained or cluster.overconstrained
|
overconstrained = overconstrained or cluster.overconstrained
|
||||||
output.overconstrained = overconstrained
|
output.overconstrained = overconstrained
|
||||||
|
|
||||||
|
# determine infinc before adding (used later)
|
||||||
|
infinc = self._is_information_increasing(merge)
|
||||||
|
|
||||||
# add to graph
|
# add to graph
|
||||||
self._add_cluster(output)
|
self._add_cluster(output)
|
||||||
self._add_method(merge)
|
self._add_method(merge)
|
||||||
|
@ -519,9 +524,11 @@ class ClusterSolver(Notifier):
|
||||||
self._add_root_method(merge.input_clusters(),merge.outputs()[0])
|
self._add_root_method(merge.input_clusters(),merge.outputs()[0])
|
||||||
|
|
||||||
# add solution selection methods, only if information increasing
|
# add solution selection methods, only if information increasing
|
||||||
if self._is_information_increasing(merge):
|
if infinc:
|
||||||
output2 = self._add_prototype_selector(merge)
|
output2 = self._add_prototype_selector(merge)
|
||||||
output3 = self._add_solution_selector(output2)
|
output3 = self._add_solution_selector(output2)
|
||||||
|
|
||||||
|
# success
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _add_root_method(self,inclusters,outcluster):
|
def _add_root_method(self,inclusters,outcluster):
|
||||||
|
|
|
@ -962,11 +962,11 @@ def test3d():
|
||||||
#test(diamond_3d(),False)
|
#test(diamond_3d(),False)
|
||||||
|
|
||||||
def test2d():
|
def test2d():
|
||||||
|
#diag_select("clsolver")
|
||||||
#test(ddd_problem())
|
#test(ddd_problem())
|
||||||
#test(double_triangle())
|
#test(double_triangle())
|
||||||
#test(triple_double_triangle())
|
test(triple_double_triangle())
|
||||||
diag_select("clsolver")
|
#test(dad_problem())
|
||||||
test(dad_problem())
|
|
||||||
#test(add_problem())
|
#test(add_problem())
|
||||||
#test(ada_problem())
|
#test(ada_problem())
|
||||||
#test(aad_problem())
|
#test(aad_problem())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user