[jboss-jira] [JBoss JIRA] (JBRULES-3461) Planning entity's hashCode() (used by tabu accepter) vs solutionHashCode() (used by solution equality)

Geoffrey De Smet (JIRA) jira-events at lists.jboss.org
Sat Apr 14 07:47:19 EDT 2012


Geoffrey De Smet created JBRULES-3461:
-----------------------------------------

             Summary: Planning entity's hashCode() (used by tabu accepter) vs solutionHashCode() (used by solution equality)
                 Key: JBRULES-3461
                 URL: https://issues.jboss.org/browse/JBRULES-3461
             Project: Drools
          Issue Type: Task
      Security Level: Public (Everyone can see)
          Components: drools-planner
            Reporter: Geoffrey De Smet
            Assignee: Geoffrey De Smet


Discussion started in JBRULES-3439.

Summary:
1) Planning entity solutionHashCode() and hashCode() are both needed. What's the difference and why not one method?
Reason: solutionHashCode() must include the variables, and hashCode() must not include the variables
2) solutionHashCode() will be obsolete once Solution.equals/hashCode() gets implemented automatically by planner by just looking at the entities and variables.
3) What if the users does want to include the variables in it's equals method. Can the tabu accepter work on some sort of entity.getId() value?
Note: It can not work with IdentityHashMap because there will be different instances (especially in multi-threading or multi-vm).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list