private boolean symmetryBreakingForStayingVMs ( ReconfigurationProblem rp ) { for ( VM vm : rp . getFutureRunningVMs ( ) ) { VMTransition a = rp . getVMAction ( vm ) ; Slice dSlice = a . getDSlice ( ) ; Slice cSlice = a . getCSlice ( ) ; if ( dSlice != null && cSlice != null ) { BoolVar stay = ( ( KeepRunningVM ) a ) . isStaying ( ) ; Boolean ret = strictlyDecreasingOrUnchanged ( vm ) ; if ( Boolean . TRUE . equals ( ret ) && ! zeroDuration ( rp , stay , cSlice ) ) { return false ; //Else, the resource usage is decreasing, so // we set the cSlice duration to 0 to directly reduces the resource allocation } else if ( Boolean . FALSE . equals ( ret ) && ! zeroDuration ( rp , stay , dSlice ) ) { //If the resource usage will be increasing //Then the duration of the dSlice can be set to 0 //(the allocation will be performed at the end of the reconfiguration process) return false ; } } } return true ; }
Symmetry breaking for VMs that stay running on the same node .