Skip to content
Snippets Groups Projects
Commit 7ed5b68d authored by Alex's avatar Alex
Browse files

fixed computing of gain

parent f09831da
No related branches found
No related tags found
No related merge requests found
...@@ -105,7 +105,7 @@ class MGM2Mind(val context : Context = new Context(), ...@@ -105,7 +105,7 @@ class MGM2Mind(val context : Context = new Context(),
myValue != context.getValue(potentialPartner).get) { // If this is a move from the current context myValue != context.getValue(potentialPartner).get) { // If this is a move from the current context
val potentialContext: Context = context.fix(variable, myValue).fix(potentialPartner, partnerValue) val potentialContext: Context = context.fix(variable, myValue).fix(potentialPartner, partnerValue)
val potentialCost: Double = potentialContext.cost(constraints) val potentialCost: Double = potentialContext.cost(constraints)
val gain = currentCost - potentialCost val gain = potentialCost - currentCost
val move = new BilateralMove(potentialContext, gain) val move = new BilateralMove(potentialContext, gain)
moves ::= move moves ::= move
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment