aggregator-core/src/main/java/org/arrowhead/wp5/agg/optim/AmountFlexOptimizer.java
public boolean optimizeAmounts() {
    	int numIter = 11;
    	    	
	    for(int i=0; i < numIter; i++) {
	    	
	    	this.handleTotalConstraints = i != 0;
	    	
	    	for(int fid = 0; fid < this.fp.getFlexOffers().size(); fid++) {
	    		FlexOffer f = this.fp.getFlexOffers().get(fid);
	    		
	    		for(int sliceId = 0; sliceId < f.getSlices().length; sliceId++) {
	    			this.optimizeAmount(fid, sliceId);
	    		}
	    	}
	    	
	    	if (this.isValidSolution()){ break; }
    	}
	    
	    return this.isValidSolution();
    }
// Optimize amounts, return true if it is a valid solution
Optimize amounts, return true if it is a valid solution
Optimize amounts return true if it is a valid solution
public boolean optimizeAmounts() {
    	int numIter = 11;
	    for(int i=0; i < numIter; i++) {
	    	this.handleTotalConstraints = i != 0;
	    	for(int fid = 0; fid < this.fp.getFlexOffers().size(); fid++) {
	    		FlexOffer f = this.fp.getFlexOffers().get(fid);
	    		for(int sliceId = 0; sliceId < f.getSlices().length; sliceId++) {
	    			this.optimizeAmount(fid, sliceId);
	    		}
	    	}
	    	if (this.isValidSolution()){ break; }
    	}
	    return this.isValidSolution();
    }
public boolean optimizeAmounts ( ) { int numIter = 11 ; for ( int i = 0 ; i < numIter ; i ++ ) { this . handleTotalConstraints = i != 0 ; for ( int fid = 0 ; fid < this . fp . getFlexOffers ( ) . size ( ) ; fid ++ ) { FlexOffer f = this . fp . getFlexOffers ( ) . get ( fid ) ; for ( int sliceId = 0 ; sliceId < f . getSlices ( ) . length ; sliceId ++ ) { this . optimizeAmount ( fid , sliceId ) ; } } if ( this . isValidSolution ( ) ) { break ; } } return this . isValidSolution ( ) ; }
Optimize amounts, return true if it is a valid solution
Optimize amounts return true if it is a valid solution