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

- Remove remaining failure rate checks in the system model adapter.

- Show an Exception Dialog if the DSE fails during input parsing.
parent 4390e7fd
No related branches found
No related tags found
No related merge requests found
...@@ -71,7 +71,6 @@ import org.fortiss.af3.platform.model.GatewayUnit; ...@@ -71,7 +71,6 @@ import org.fortiss.af3.platform.model.GatewayUnit;
import org.fortiss.af3.platform.model.IPlatformArchitectureElement; import org.fortiss.af3.platform.model.IPlatformArchitectureElement;
import org.fortiss.af3.platform.model.IPlatformExport; import org.fortiss.af3.platform.model.IPlatformExport;
import org.fortiss.af3.platform.model.IPlatformResource; import org.fortiss.af3.platform.model.IPlatformResource;
import org.fortiss.af3.platform.model.IVirtualizationPlatformArchitectureElement;
import org.fortiss.af3.platform.model.MemoryUnit; import org.fortiss.af3.platform.model.MemoryUnit;
import org.fortiss.af3.platform.model.PlatformArchitecture; import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.platform.model.TransmissionUnit; import org.fortiss.af3.platform.model.TransmissionUnit;
...@@ -573,11 +572,11 @@ public class AF3SystemModelAdapter ...@@ -573,11 +572,11 @@ public class AF3SystemModelAdapter
for(MemoryUnit currentMemoryUnit : getChildrenWithType(platformArchitecture, for(MemoryUnit currentMemoryUnit : getChildrenWithType(platformArchitecture,
MemoryUnit.class)) { MemoryUnit.class)) {
Double failureRate = resourceFailureRates.get(currentMemoryUnit); Double failureRate = resourceFailureRates.get(currentMemoryUnit);
if(failureRate == null) { // if(failureRate == null) {
throw new Exception("The failure probablity for the " + // throw new Exception("The failure probablity for the " +
currentMemoryUnit.getClass().getSimpleName() + " " + // currentMemoryUnit.getClass().getSimpleName() + " " +
currentMemoryUnit.getName() + " has not been defined."); // currentMemoryUnit.getName() + " has not been defined.");
} // }
rval.add(new AF3MemoryUnitAdapter(currentMemoryUnit, failureRate)); rval.add(new AF3MemoryUnitAdapter(currentMemoryUnit, failureRate));
} }
...@@ -664,11 +663,11 @@ public class AF3SystemModelAdapter ...@@ -664,11 +663,11 @@ public class AF3SystemModelAdapter
for(GatewayUnit gatewayUnit : EcoreUtils.getChildrenWithType(platformArchitecture, for(GatewayUnit gatewayUnit : EcoreUtils.getChildrenWithType(platformArchitecture,
GatewayUnit.class)) { GatewayUnit.class)) {
Double failureRate = resourceFailureRates.get(gatewayUnit); Double failureRate = resourceFailureRates.get(gatewayUnit);
if(failureRate == null) { // if(failureRate == null) {
throw new Exception("The failure probablity for the " + // throw new Exception("The failure probablity for the " +
gatewayUnit.getClass().getSimpleName() + " " + gatewayUnit.getName() + // gatewayUnit.getClass().getSimpleName() + " " + gatewayUnit.getName() +
" has not been defined."); // " has not been defined.");
} // }
Double power = resourcePowerConsumption.get(gatewayUnit); Double power = resourcePowerConsumption.get(gatewayUnit);
// TODO: We do not have a power annotation for gateways yet. // TODO: We do not have a power annotation for gateways yet.
// if(power == null) { // if(power == null) {
...@@ -700,19 +699,19 @@ public class AF3SystemModelAdapter ...@@ -700,19 +699,19 @@ public class AF3SystemModelAdapter
Double failureRate = resourceFailureRates.get(transmissionUnit); Double failureRate = resourceFailureRates.get(transmissionUnit);
// TODO: Virtual TransmissionUnits currently do not have ResourceLinks to their physical // TODO: Virtual TransmissionUnits currently do not have ResourceLinks to their physical
// counterparts. // counterparts.
if(!(transmissionUnit instanceof IVirtualizationPlatformArchitectureElement) && // if(!(transmissionUnit instanceof IVirtualizationPlatformArchitectureElement) &&
failureRate == null) { // failureRate == null) {
throw new Exception("The failure probablity for the " + // throw new Exception("The failure probablity for the " +
transmissionUnit.getClass().getSimpleName() + " " + // transmissionUnit.getClass().getSimpleName() + " " +
transmissionUnit.getName() + " has not been defined."); // transmissionUnit.getName() + " has not been defined.");
} // }
Double power = resourcePowerConsumption.get(transmissionUnit); Double power = resourcePowerConsumption.get(transmissionUnit);
if(!(transmissionUnit instanceof IVirtualizationPlatformArchitectureElement) && // if(!(transmissionUnit instanceof IVirtualizationPlatformArchitectureElement) &&
power == null) { // power == null) {
throw new Exception("The failure probablity for the " + // throw new Exception("The failure probablity for the " +
transmissionUnit.getClass().getSimpleName() + " " + // transmissionUnit.getClass().getSimpleName() + " " +
transmissionUnit.getName() + " has not been defined."); // transmissionUnit.getName() + " has not been defined.");
} // }
rval.add(new AF3TransmissionUnitAdapter(transmissionUnit, failureRate, power)); rval.add(new AF3TransmissionUnitAdapter(transmissionUnit, failureRate, power));
} }
......
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