From 002a02d370bc43009cb00871b5ef57ab0789f603 Mon Sep 17 00:00:00 2001 From: Alexander Diewald <diewald@fortiss.org> Date: Thu, 23 Feb 2017 14:52:37 +0000 Subject: [PATCH] - Remove remaining failure rate checks in the system model adapter. - Show an Exception Dialog if the DSE fails during input parsing. --- .../arch/af3/AF3SystemModelAdapter.java | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/AF3SystemModelAdapter.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/AF3SystemModelAdapter.java index 574e3f0f..cc3d399c 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/AF3SystemModelAdapter.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/AF3SystemModelAdapter.java @@ -71,7 +71,6 @@ import org.fortiss.af3.platform.model.GatewayUnit; import org.fortiss.af3.platform.model.IPlatformArchitectureElement; import org.fortiss.af3.platform.model.IPlatformExport; 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.PlatformArchitecture; import org.fortiss.af3.platform.model.TransmissionUnit; @@ -573,11 +572,11 @@ public class AF3SystemModelAdapter for(MemoryUnit currentMemoryUnit : getChildrenWithType(platformArchitecture, MemoryUnit.class)) { Double failureRate = resourceFailureRates.get(currentMemoryUnit); - if(failureRate == null) { - throw new Exception("The failure probablity for the " + - currentMemoryUnit.getClass().getSimpleName() + " " + - currentMemoryUnit.getName() + " has not been defined."); - } + // if(failureRate == null) { + // throw new Exception("The failure probablity for the " + + // currentMemoryUnit.getClass().getSimpleName() + " " + + // currentMemoryUnit.getName() + " has not been defined."); + // } rval.add(new AF3MemoryUnitAdapter(currentMemoryUnit, failureRate)); } @@ -664,11 +663,11 @@ public class AF3SystemModelAdapter for(GatewayUnit gatewayUnit : EcoreUtils.getChildrenWithType(platformArchitecture, GatewayUnit.class)) { Double failureRate = resourceFailureRates.get(gatewayUnit); - if(failureRate == null) { - throw new Exception("The failure probablity for the " + - gatewayUnit.getClass().getSimpleName() + " " + gatewayUnit.getName() + - " has not been defined."); - } + // if(failureRate == null) { + // throw new Exception("The failure probablity for the " + + // gatewayUnit.getClass().getSimpleName() + " " + gatewayUnit.getName() + + // " has not been defined."); + // } Double power = resourcePowerConsumption.get(gatewayUnit); // TODO: We do not have a power annotation for gateways yet. // if(power == null) { @@ -700,19 +699,19 @@ public class AF3SystemModelAdapter Double failureRate = resourceFailureRates.get(transmissionUnit); // TODO: Virtual TransmissionUnits currently do not have ResourceLinks to their physical // counterparts. - if(!(transmissionUnit instanceof IVirtualizationPlatformArchitectureElement) && - failureRate == null) { - throw new Exception("The failure probablity for the " + - transmissionUnit.getClass().getSimpleName() + " " + - transmissionUnit.getName() + " has not been defined."); - } + // if(!(transmissionUnit instanceof IVirtualizationPlatformArchitectureElement) && + // failureRate == null) { + // throw new Exception("The failure probablity for the " + + // transmissionUnit.getClass().getSimpleName() + " " + + // transmissionUnit.getName() + " has not been defined."); + // } Double power = resourcePowerConsumption.get(transmissionUnit); - if(!(transmissionUnit instanceof IVirtualizationPlatformArchitectureElement) && - power == null) { - throw new Exception("The failure probablity for the " + - transmissionUnit.getClass().getSimpleName() + " " + - transmissionUnit.getName() + " has not been defined."); - } + // if(!(transmissionUnit instanceof IVirtualizationPlatformArchitectureElement) && + // power == null) { + // throw new Exception("The failure probablity for the " + + // transmissionUnit.getClass().getSimpleName() + " " + + // transmissionUnit.getName() + " has not been defined."); + // } rval.add(new AF3TransmissionUnitAdapter(transmissionUnit, failureRate, power)); } -- GitLab