Skip to content
Snippets Groups Projects
Commit 9972382e authored by Alexander Diewald's avatar Alexander Diewald
Browse files

- Remove the deprecated EnergyConsumption annotation.

parent d27e1233
No related branches found
No related tags found
No related merge requests found
......@@ -94,8 +94,7 @@ public class EnergyObjectiveEvaluator<S extends TaskMappingEntry, T extends Task
IDeployableComponentAdapter<?> deployedComponent =
t.getDeployedRequester().getDeployableComponent();
energy +=
getConsumedEnergy(t.getDuration(), executionUnit, deployedComponent);
energy += deployedComponent.getEnergyConsumption(executionUnit);
} else if(deploymentTarget instanceof ICommunicationResourceAdapter) {
ICommunicationResourceAdapter<?> commResource =
(ICommunicationResourceAdapter<?>)deploymentTarget;
......@@ -108,20 +107,6 @@ public class EnergyObjectiveEvaluator<S extends TaskMappingEntry, T extends Task
return new DoubleValue(energy);
}
/**
* Returns the consumed energy of the given allocation given by the deployment specific
* parameter map or by calculation via the WCET of the deployed
* {@link IDeployableComponentAdapter} and the speed of the {@link IExecutionUnitAdapter}.
*/
private double getConsumedEnergy(double duration, IExecutionUnitAdapter<?> executionUnit,
IDeployableComponentAdapter<?> deployedComponent) {
double deployedEnergyDemand = deployedComponent.getWcet(executionUnit);
if(deployedEnergyDemand <= 0.0) {
deployedEnergyDemand = executionUnit.getPower(duration);
}
return deployedEnergyDemand;
}
/**
* {@inheritDoc}
*
......
......@@ -27,13 +27,6 @@ package org.fortiss.af3.exploration.alg.dse.sysmodel.arch;
* @ConQAT.Rating YELLOW Hash: 73C18E52E3E9E6F8CC8B674ED8A64458
*/
public interface IExecutionUnitAdapter<T> extends IResourceAdapter<T> {
/**
* Returns the power consumption of a given {@link IExecutionUnitAdapter} for the execution of
* a
* task of the given instruction count.
*/
double getPower(double d);
/**
* Returns the SafeFailureFraction of an execution unit. This value is required for calculating
* the safety level of a task for a given allocation.
......
......@@ -35,9 +35,6 @@ import org.fortiss.af3.safety.model.annotation.SafeFailureFraction;
*/
public class AF3ExecutionUnitAdapter extends AF3ResourceAdapter<ExecutionUnit> implements
IExecutionUnitAdapter<ExecutionUnit> {
/** Execution unit speed annotation */
private double executionUnitPower;
/** Execution unit safe failure fraction annotation. */
private SafeFailureFraction safeFailureFraction;
......@@ -53,21 +50,14 @@ public class AF3ExecutionUnitAdapter extends AF3ResourceAdapter<ExecutionUnit> i
*
* @throws Exception
*/
public AF3ExecutionUnitAdapter(ExecutionUnit executionUnit, Double failureProb, Double power)
public AF3ExecutionUnitAdapter(ExecutionUnit executionUnit, Double failureProb)
throws Exception {
super(executionUnit, failureProb);
this.executionUnitPower = power;
safeFailureFraction =
pickFirstInstanceOf(SafeFailureFraction.class, executionUnit.getSpecifications());
}
/** {@inheritDoc} */
@Override
public double getPower(double duration) {
return executionUnitPower * duration;
}
/** {@inheritDoc} */
@Override
public double getSafeFailureFraction() {
......
......@@ -155,8 +155,7 @@ public class AF3SystemModelAdapter
this.deploymentTargets =
createDeploymentTargets(systemParameters.getDeploymentTargets(),
systemParameters.getResourceFailureProbabilities(),
systemParameters.getResourcePowerConsumption());
systemParameters.getResourceFailureProbabilities());
memoryUnits =
createMemoryUnits(platformArchitecture,
......@@ -598,8 +597,7 @@ public class AF3SystemModelAdapter
*/
private Collection<IExecutionUnitAdapter<ExecutionUnit>> createDeploymentTargets(
Collection<ExecutionUnit> targetExecutionUnits,
Map<IPlatformArchitectureElement, Double> resourceFailureProbabilies,
Map<IPlatformResource, Double> resourcePowerConsumption) throws Exception {
Map<IPlatformArchitectureElement, Double> resourceFailureProbabilies) throws Exception {
if(targetExecutionUnits.isEmpty()) {
throw new Exception(
"No deployment targets have been specified in the target platform architecture(s). Please check whether the correct platform architecture was selected and whether the desired Execution Units were selected as deployment targets (Platform Model --> Annotation View --> Deployment Target)");
......@@ -610,18 +608,7 @@ public class AF3SystemModelAdapter
for(ExecutionUnit execUnit : targetExecutionUnits) {
Double failureProb = resourceFailureProbabilies.get(execUnit);
// if(failureProb == null) {
// throw new Exception("The failure probablity for the target execution unit " +
// execUnit.getName() + " has not been defined.");
// }
Double power = resourcePowerConsumption.get(execUnit);
if(power == null) {
throw new Exception("The active power consumption for the target execution unit " +
execUnit.getName() + " has not been defined.");
}
rval.add(new AF3ExecutionUnitAdapter(execUnit, failureProb, power));
rval.add(new AF3ExecutionUnitAdapter(execUnit, failureProb));
}
return rval;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment