Bug 1165601

Summary: SwapMove and PillarSwapMove return redundant values in getPlanningValues() method, if entities share some values.
Product: [Retired] JBoss BRMS Platform 6 Reporter: jvahala
Component: OptaPlannerAssignee: Geoffrey De Smet <gdesmet>
Status: CLOSED WONTFIX QA Contact: jvahala
Severity: high Docs Contact:
Priority: low    
Version: 6.1.0CC: kverlaen, lpetrovi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 14:05:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jvahala 2014-11-19 10:27:22 UTC
Reproducer based on optaplanner unit tests: 
@Test
public void getPlanningValues() {
    TestdataValue v1 = new TestdataValue("1");
    TestdataValue v2 = new TestdataValue("2");
    TestdataValue v3 = new TestdataValue("3");

    TestdataMultiVarEntity a = new TestdataMultiVarEntity("a", v1, v2, null);
    TestdataMultiVarEntity b = new TestdataMultiVarEntity("b", v1, v3, null);

    EntityDescriptor entityDescriptor = TestdataMultiVarEntity.buildEntityDescriptor();
    SwapMove move = new SwapMove(entityDescriptor.getGenuineVariableDescriptors(), a, b);

    List<Object> values = (List<Object>) move.getPlanningValues();
}

Actual results: "values" array contains {null, null, 1, 1, 2, 3}, where "1" is redundant.  

Expected results: shoudl contains only {null, 1, 2, 3}

Additional info: This issue corresponds with bigger problem: https://issues.jboss.org/browse/PLANNER-278

Comment 2 Geoffrey De Smet 2014-12-03 09:30:48 UTC
We're going to fix this different, to avoid an unneeded performance loss,
as part of the big Tabu Search Rennaissance, which won't be in 6.2:
  https://issues.jboss.org/browse/PLANNER-279

Meanwhile: this issue should has no impact on the user's code and only a minor impact (if any) on the solver behavior, because AbstractTabuAcceptor puts both duplicates in the same map, so the first is discarded automatically anyway.

Comment 3 jvahala 2015-12-07 14:05:08 UTC
Since whole tabu search needs to be rewritten(see https://issues.jboss.org/browse/PLANNER-279) and since this issue is not serious perf killer I am closing the BZ