private void checkInitialSatisfaction ( ) { //Seems to me we don't support ratio change for ( Node n : rp . getSourceModel ( ) . getMapping ( ) . getOnlineNodes ( ) ) { int nIdx = rp . getNode ( n ) ; double ratio = getOverbookRatio ( nIdx ) /*.getLB()*/ ; double capa = getSourceResource ( ) . getCapacity ( n ) * ratio ; int usage = 0 ; for ( VM vm : rp . getSourceModel ( ) . getMapping ( ) . getRunningVMs ( n ) ) { usage += getSourceResource ( ) . getConsumption ( vm ) ; if ( usage > capa ) { //Here, the problem is not feasible but we consider an exception //because such a situation does not physically makes sense (one cannot run at 110%) throw new SchedulerModelingException ( rp . getSourceModel ( ) , "Usage of virtual resource " + getResourceIdentifier ( ) + " on node " + n + " (" + usage + ") exceeds its capacity (" + capa + ")" ) ; } } } }
Check if the initial capacity > sum current consumption The ratio is instantiated now so the computation is correct