CPD Results

The following document contains the results of PMD's CPD 4.2.2.

Duplications

File Line
entropy/constraintsSolver/constraint/MinimizeReconfigurationCost.java 148
entropy/constraintsSolver/constraint/MinimizeReorganizationCost.java 114
			}
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void awakeOnInst(int idx) throws ContradictionException {
		this.constAwake(false);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void awakeOnInf(int idx) throws ContradictionException {
		this.constAwake(false);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void awakeOnSup(int idx) throws ContradictionException {
		this.constAwake(false);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void awakeOnBounds(int idx) throws ContradictionException {
		this.constAwake(false);
	}

	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void awakeOnRem(int idx, int i) throws ContradictionException {
		this.constAwake(false);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void awakeOnRemovals(int idx, IntIterator deltaDomain)
			throws ContradictionException {
		this.constAwake(false);
	}
}

File Line
entropy/decision/VirtualMachinesPackingProblem.java 132
entropy/plan/ReorganizationProblem.java 142
		for (VirtualMachine vm : curConf.getWaitings()) {
			totalNeed += vm.getCPUConsumption();
		}

		int needs4CPU = 0;
		for (Node n : nodes) {
			if (totalNeed <= 0) {
				break;
			}
			totalNeed -= n.getCPUCapacity();
			needs4CPU++;
		}
		
		Collections.sort(nodes, new ManagedElementComparator<Node>(false, Node.MEMORY_TOTAL));
		for (VirtualMachine vm : curConf.getRunnings()) {
			totalNeed += vm.getMemoryConsumption();
		}
		int needs4Mem = 0;
		for (Node n : nodes) {
			if (totalNeed <= 0) {
				break;
			}
			totalNeed -= n.getMemoryTotal();
			needs4Mem++;
		}

File Line
entropy/plan/ReorganizationProblem.java 99
entropy/plan/VirtualMachinesReplacementProblem.java 100
        for (Node node : this.getSourceConfiguration().getOnlines()) {
        	model.addConstraint(new IntKnapsackConstraint(model.getProblem(), model.getBooleanAssignmentVars(node), model.getVirtualMachineResourcesValue(VirtualMachine.MEMORY), model.getNodeResource(node, Node.MEMORY_TOTAL)));
        	model.addConstraint(new IntKnapsackConstraint(model.getProblem(), model.getBooleanAssignmentVars(node), model.getVirtualMachineResourcesValue(VirtualMachine.CPU_CONSUMPTION), model.getNodeResource(node, Node.CPU_CAPACITY)));
        }

        
        model.addConstraint(new MinimizeReconfigurationCost(model, costVar, costFunction));

File Line
entropy/decision/VirtualMachinesAssignmentProblem.java 76
entropy/decision/VirtualMachinesPackingProblem.java 102
        for (Node node : curConf.getOnlines()) {
        	model.addConstraint(new IntKnapsackConstraint(model.getProblem(), model.getBooleanAssignmentVars(node), model.getVirtualMachineResourcesValue(VirtualMachine.MEMORY), model.getNodeResource(node, Node.MEMORY_TOTAL)));
        	model.addConstraint(new IntKnapsackConstraint(model.getProblem(), model.getBooleanAssignmentVars(node), model.getVirtualMachineResourcesValue(VirtualMachine.CPU_CONSUMPTION), model.getNodeResource(node, Node.CPU_CAPACITY)));
        }
        
        model.setVirtualMachineSelector(new BiggestUnassignedVirtualMachine(model, nodes, VirtualMachine.MEMORY));