[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:53:18 EDT 2012


    [ https://issues.jboss.org/browse/JBRULES-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12684215#comment-12684215 ] 

Geoffrey De Smet commented on JBRULES-3461:
-------------------------------------------

3b) When we go multi-threaded, Planner will track an "internalId" for every entity - this is probably the way to implement 3), instead of forcing some sort of getId() method down the user's throat.
                
> 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