package schedframe.scheduling; import schedframe.scheduling.utils.DescriptionContainer; import schedframe.scheduling.utils.ResourceParameterName; /** * * @author Marcin Krystek * * @param */ public abstract class AbstractResourceRequirements implements DescriptionContainer { protected T resourceRequirements; protected boolean isBestEffort; protected AbstractResourceRequirements(){ this.isBestEffort = true; } /** * * @param parameterName name of the task resource requirement * @return value of the numeral parameter which describes task resource requirement * @throws NoSuchFieldException if such parameter is not defined * @throws IllegalArgumentException if requested parameter is String value */ public abstract double getParameterDoubleValue(ResourceParameterName parameterName) throws NoSuchFieldException, IllegalArgumentException; /** * * @param parameterName name of the task resource requirement * @return value of the String parameter which describes task resource requirement * @throws NoSuchFieldException if such parameter is not defined * @throws IllegalArgumentException if requested parameter is Double value */ public abstract String getParameterStringValue(ResourceParameterName parameterName) throws NoSuchFieldException, IllegalArgumentException; public double getCpuCntRequest() throws NoSuchFieldException{ return getParameterDoubleValue(ResourceParameterName.CPUCOUNT); } public double getMemoryRequest() throws NoSuchFieldException{ return getParameterDoubleValue(ResourceParameterName.MEMORY); } public int getProcessesCount(){ return 1; } public boolean isBestEffort(){ return this.isBestEffort; } public void setBestEffort(boolean value){ this.isBestEffort = value; } }