Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Edlund2011-07-11 22:58:54 +0000
committerStefan Edlund2011-07-11 22:58:54 +0000
commitaec11ff5c606cc50775a140e53e580b54df602c8 (patch)
tree8e9ea9dced26c71c5c0458663de0977c5806fa12 /org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl
parent059918e69dc0f2c9bd209e79d1a56be7252d4159 (diff)
downloadorg.eclipse.stem-aec11ff5c606cc50775a140e53e580b54df602c8.tar.gz
org.eclipse.stem-aec11ff5c606cc50775a140e53e580b54df602c8.tar.xz
org.eclipse.stem-aec11ff5c606cc50775a140e53e580b54df602c8.zip
Interventions. Modifiers can now operate on the static intervention labels and example interventions have been implemented for standard deterministic SIR and SEIR models
git-svn-id: http://dev.eclipse.org/svnroot/technology/org.eclipse.stem/trunk@2048 92a21009-5b66-0410-b83a-dc787c41c6e9
Diffstat (limited to 'org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl')
-rw-r--r--org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlGraphGeneratorImpl.java14
-rw-r--r--org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlLabelImpl.java180
-rw-r--r--org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionLabelImpl.java45
-rw-r--r--org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionLabelValueImpl.java (renamed from org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlLabelValueImpl.java)16
-rw-r--r--org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionsFactoryImpl.java27
-rw-r--r--org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionsPackageImpl.java183
-rw-r--r--org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/LabelValueTestImpl.java561
-rw-r--r--org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardInterventionLabelImpl.java (renamed from org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardControlLabelImpl.java)25
-rw-r--r--org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardInterventionLabelValueImpl.java (renamed from org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardControlLabelValueImpl.java)36
9 files changed, 136 insertions, 951 deletions
diff --git a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlGraphGeneratorImpl.java b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlGraphGeneratorImpl.java
index 08ee195cc..a71a4daef 100644
--- a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlGraphGeneratorImpl.java
+++ b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlGraphGeneratorImpl.java
@@ -39,8 +39,8 @@ import org.eclipse.stem.graphgenerators.impl.GraphGeneratorImpl;
import org.eclipse.stem.interventions.ControlGraphGenerator;
import org.eclipse.stem.interventions.InterventionsFactory;
import org.eclipse.stem.interventions.InterventionsPackage;
-import org.eclipse.stem.interventions.StandardControlLabel;
-import org.eclipse.stem.interventions.StandardControlLabelValue;
+import org.eclipse.stem.interventions.StandardInterventionLabel;
+import org.eclipse.stem.interventions.StandardInterventionLabelValue;
/**
* <!-- begin-user-doc -->
@@ -182,8 +182,6 @@ public class ControlGraphGeneratorImpl extends GraphGeneratorImpl implements Con
SimpleDateFormat formatter = new SimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");
String valid = formatter.format(c.getTime());
dc.setValid(valid);
- // TODO for now, just for testing
- // gets ALL common border edges
Set<Node> allNodes = LocationUtility.getNodes(project, this.getLocation());
Iterator<Node> iter = allNodes.iterator();
@@ -191,17 +189,15 @@ public class ControlGraphGeneratorImpl extends GraphGeneratorImpl implements Con
Node n = iter.next();
- StandardControlLabel scl = InterventionsFactory.eINSTANCE.createStandardControlLabel();
+ StandardInterventionLabel scl = InterventionsFactory.eINSTANCE.createStandardInterventionLabel();
scl.setURIOfIdentifiableToBeLabeled(n.getURI());
scl.setPopulationIdentifier(this.getPopulationIdentifier());
- StandardControlLabelValue currentValue = InterventionsFactory.eINSTANCE.createStandardControlLabelValue();
- StandardControlLabelValue originalValue = InterventionsFactory.eINSTANCE.createStandardControlLabelValue();
+ StandardInterventionLabelValue currentValue = InterventionsFactory.eINSTANCE.createStandardInterventionLabelValue();
scl.setCurrentValue(currentValue);
- scl.setOriginalValue(originalValue);
// We need to find the population label to get the actual initial number of
// daily isolations/vaccinations
@@ -216,8 +212,6 @@ public class ControlGraphGeneratorImpl extends GraphGeneratorImpl implements Con
}
currentValue.setIsolations(this.getIsolationFraction()*population);
currentValue.setVaccinations(this.getVaccinationFraction()*population);
- originalValue.setIsolations(this.getIsolationFraction()*population);
- originalValue.setVaccinations(this.getVaccinationFraction()*population);
graph.putNodeLabel(scl);
}
diff --git a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlLabelImpl.java b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlLabelImpl.java
deleted file mode 100644
index e854f2196..000000000
--- a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlLabelImpl.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.stem.interventions.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.stem.core.graph.LabelValue;
-import org.eclipse.stem.core.graph.impl.NodeLabelImpl;
-import org.eclipse.stem.core.graph.impl.LabelValueImpl;
-
-import org.eclipse.stem.interventions.ControlLabel;
-import org.eclipse.stem.interventions.InterventionsPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Control Label</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.stem.interventions.impl.ControlLabelImpl#getOriginalValue <em>Original Value</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public abstract class ControlLabelImpl extends NodeLabelImpl implements ControlLabel {
- /**
- * The cached value of the '{@link #getOriginalValue() <em>Original Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOriginalValue()
- * @generated
- * @ordered
- */
- protected LabelValue originalValue;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ControlLabelImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return InterventionsPackage.Literals.CONTROL_LABEL;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public LabelValue getOriginalValue() {
- return originalValue;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetOriginalValue(LabelValue newOriginalValue, NotificationChain msgs) {
- LabelValue oldOriginalValue = originalValue;
- originalValue = newOriginalValue;
- if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, InterventionsPackage.CONTROL_LABEL__ORIGINAL_VALUE, oldOriginalValue, newOriginalValue);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setOriginalValue(LabelValue newOriginalValue) {
- if (newOriginalValue != originalValue) {
- NotificationChain msgs = null;
- if (originalValue != null)
- msgs = ((InternalEObject)originalValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - InterventionsPackage.CONTROL_LABEL__ORIGINAL_VALUE, null, msgs);
- if (newOriginalValue != null)
- msgs = ((InternalEObject)newOriginalValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - InterventionsPackage.CONTROL_LABEL__ORIGINAL_VALUE, null, msgs);
- msgs = basicSetOriginalValue(newOriginalValue, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.CONTROL_LABEL__ORIGINAL_VALUE, newOriginalValue, newOriginalValue));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case InterventionsPackage.CONTROL_LABEL__ORIGINAL_VALUE:
- return basicSetOriginalValue(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case InterventionsPackage.CONTROL_LABEL__ORIGINAL_VALUE:
- return getOriginalValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case InterventionsPackage.CONTROL_LABEL__ORIGINAL_VALUE:
- setOriginalValue((LabelValue)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case InterventionsPackage.CONTROL_LABEL__ORIGINAL_VALUE:
- setOriginalValue((LabelValue)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case InterventionsPackage.CONTROL_LABEL__ORIGINAL_VALUE:
- return originalValue != null;
- }
- return super.eIsSet(featureID);
- }
-
-} //ControlLabelImpl
diff --git a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionLabelImpl.java b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionLabelImpl.java
new file mode 100644
index 000000000..d5e107ff4
--- /dev/null
+++ b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionLabelImpl.java
@@ -0,0 +1,45 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.stem.interventions.impl;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.stem.core.graph.impl.StaticNodeLabelImpl;
+
+import org.eclipse.stem.interventions.InterventionLabel;
+import org.eclipse.stem.interventions.InterventionsPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Intervention Label</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public abstract class InterventionLabelImpl extends StaticNodeLabelImpl implements InterventionLabel {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected InterventionLabelImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return InterventionsPackage.Literals.INTERVENTION_LABEL;
+ }
+
+} //InterventionLabelImpl
diff --git a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlLabelValueImpl.java b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionLabelValueImpl.java
index 4edcf358b..bbf75cf65 100644
--- a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/ControlLabelValueImpl.java
+++ b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionLabelValueImpl.java
@@ -6,33 +6,29 @@
*/
package org.eclipse.stem.interventions.impl;
-import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
import org.eclipse.stem.core.graph.impl.LabelValueImpl;
-import org.eclipse.stem.interventions.ControlLabelValue;
+import org.eclipse.stem.interventions.InterventionLabelValue;
import org.eclipse.stem.interventions.InterventionsPackage;
/**
* <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Control Label Value</b></em>'.
+ * An implementation of the model object '<em><b>Intervention Label Value</b></em>'.
* <!-- end-user-doc -->
* <p>
* </p>
*
* @generated
*/
-public abstract class ControlLabelValueImpl extends LabelValueImpl implements ControlLabelValue {
+public abstract class InterventionLabelValueImpl extends LabelValueImpl implements InterventionLabelValue {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- protected ControlLabelValueImpl() {
+ protected InterventionLabelValueImpl() {
super();
}
@@ -43,7 +39,7 @@ public abstract class ControlLabelValueImpl extends LabelValueImpl implements Co
*/
@Override
protected EClass eStaticClass() {
- return InterventionsPackage.Literals.CONTROL_LABEL_VALUE;
+ return InterventionsPackage.Literals.INTERVENTION_LABEL_VALUE;
}
-} //ControlLabelValueImpl
+} //InterventionLabelValueImpl
diff --git a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionsFactoryImpl.java b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionsFactoryImpl.java
index 21fbf96d0..04626036a 100644
--- a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionsFactoryImpl.java
+++ b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionsFactoryImpl.java
@@ -65,10 +65,9 @@ public class InterventionsFactoryImpl extends EFactoryImpl implements Interventi
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
- case InterventionsPackage.LABEL_VALUE_TEST: return createLabelValueTest();
- case InterventionsPackage.STANDARD_CONTROL_LABEL: return createStandardControlLabel();
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL: return createStandardInterventionLabel();
case InterventionsPackage.CONTROL_GRAPH_GENERATOR: return createControlGraphGenerator();
- case InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE: return createStandardControlLabelValue();
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE: return createStandardInterventionLabelValue();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -79,19 +78,9 @@ public class InterventionsFactoryImpl extends EFactoryImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- public LabelValueTest createLabelValueTest() {
- LabelValueTestImpl labelValueTest = new LabelValueTestImpl();
- return labelValueTest;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public StandardControlLabel createStandardControlLabel() {
- StandardControlLabelImpl standardControlLabel = new StandardControlLabelImpl();
- return standardControlLabel;
+ public StandardInterventionLabel createStandardInterventionLabel() {
+ StandardInterventionLabelImpl standardInterventionLabel = new StandardInterventionLabelImpl();
+ return standardInterventionLabel;
}
/**
@@ -109,9 +98,9 @@ public class InterventionsFactoryImpl extends EFactoryImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- public StandardControlLabelValue createStandardControlLabelValue() {
- StandardControlLabelValueImpl standardControlLabelValue = new StandardControlLabelValueImpl();
- return standardControlLabelValue;
+ public StandardInterventionLabelValue createStandardInterventionLabelValue() {
+ StandardInterventionLabelValueImpl standardInterventionLabelValue = new StandardInterventionLabelValueImpl();
+ return standardInterventionLabelValue;
}
/**
diff --git a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionsPackageImpl.java b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionsPackageImpl.java
index ce5b2c897..7244beea2 100644
--- a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionsPackageImpl.java
+++ b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/InterventionsPackageImpl.java
@@ -37,13 +37,12 @@ import org.eclipse.stem.core.sequencer.SequencerPackage;
import org.eclipse.stem.core.solver.SolverPackage;
import org.eclipse.stem.interventions.ControlGraphGenerator;
-import org.eclipse.stem.interventions.ControlLabel;
-import org.eclipse.stem.interventions.ControlLabelValue;
+import org.eclipse.stem.interventions.InterventionLabel;
+import org.eclipse.stem.interventions.InterventionLabelValue;
import org.eclipse.stem.interventions.InterventionsFactory;
import org.eclipse.stem.interventions.InterventionsPackage;
-import org.eclipse.stem.interventions.LabelValueTest;
-import org.eclipse.stem.interventions.StandardControlLabel;
-import org.eclipse.stem.interventions.StandardControlLabelValue;
+import org.eclipse.stem.interventions.StandardInterventionLabel;
+import org.eclipse.stem.interventions.StandardInterventionLabelValue;
/**
* <!-- begin-user-doc -->
@@ -57,19 +56,13 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- private EClass labelValueTestEClass = null;
+ private EClass interventionLabelEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass controlLabelEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass standardControlLabelEClass = null;
+ private EClass standardInterventionLabelEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -81,13 +74,13 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- private EClass controlLabelValueEClass = null;
+ private EClass interventionLabelValueEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass standardControlLabelValueEClass = null;
+ private EClass standardInterventionLabelValueEClass = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
@@ -158,35 +151,8 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- public EClass getLabelValueTest() {
- return labelValueTestEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getLabelValueTest_ModelName() {
- return (EAttribute)labelValueTestEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getLabelValueTest_TargetURI() {
- return (EAttribute)labelValueTestEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getLabelValueTest_State() {
- return (EAttribute)labelValueTestEClass.getEStructuralFeatures().get(2);
+ public EClass getInterventionLabel() {
+ return interventionLabelEClass;
}
/**
@@ -194,8 +160,8 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getLabelValueTest_Threshold() {
- return (EAttribute)labelValueTestEClass.getEStructuralFeatures().get(3);
+ public EClass getStandardInterventionLabel() {
+ return standardInterventionLabelEClass;
}
/**
@@ -203,53 +169,8 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getLabelValueTest_Predicate() {
- return (EAttribute)labelValueTestEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getLabelValueTest_PopulationIdentifier() {
- return (EAttribute)labelValueTestEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getControlLabel() {
- return controlLabelEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getControlLabel_OriginalValue() {
- return (EReference)controlLabelEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getStandardControlLabel() {
- return standardControlLabelEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getStandardControlLabel_PopulationIdentifier() {
- return (EAttribute)standardControlLabelEClass.getEStructuralFeatures().get(0);
+ public EAttribute getStandardInterventionLabel_PopulationIdentifier() {
+ return (EAttribute)standardInterventionLabelEClass.getEStructuralFeatures().get(0);
}
/**
@@ -302,8 +223,8 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- public EClass getControlLabelValue() {
- return controlLabelValueEClass;
+ public EClass getInterventionLabelValue() {
+ return interventionLabelValueEClass;
}
/**
@@ -311,8 +232,8 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- public EClass getStandardControlLabelValue() {
- return standardControlLabelValueEClass;
+ public EClass getStandardInterventionLabelValue() {
+ return standardInterventionLabelValueEClass;
}
/**
@@ -320,8 +241,8 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getStandardControlLabelValue_Vaccinations() {
- return (EAttribute)standardControlLabelValueEClass.getEStructuralFeatures().get(0);
+ public EAttribute getStandardInterventionLabelValue_Vaccinations() {
+ return (EAttribute)standardInterventionLabelValueEClass.getEStructuralFeatures().get(0);
}
/**
@@ -329,8 +250,8 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getStandardControlLabelValue_Isolations() {
- return (EAttribute)standardControlLabelValueEClass.getEStructuralFeatures().get(1);
+ public EAttribute getStandardInterventionLabelValue_Isolations() {
+ return (EAttribute)standardInterventionLabelValueEClass.getEStructuralFeatures().get(1);
}
/**
@@ -361,19 +282,10 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
isCreated = true;
// Create classes and their features
- labelValueTestEClass = createEClass(LABEL_VALUE_TEST);
- createEAttribute(labelValueTestEClass, LABEL_VALUE_TEST__MODEL_NAME);
- createEAttribute(labelValueTestEClass, LABEL_VALUE_TEST__TARGET_URI);
- createEAttribute(labelValueTestEClass, LABEL_VALUE_TEST__STATE);
- createEAttribute(labelValueTestEClass, LABEL_VALUE_TEST__THRESHOLD);
- createEAttribute(labelValueTestEClass, LABEL_VALUE_TEST__PREDICATE);
- createEAttribute(labelValueTestEClass, LABEL_VALUE_TEST__POPULATION_IDENTIFIER);
+ interventionLabelEClass = createEClass(INTERVENTION_LABEL);
- controlLabelEClass = createEClass(CONTROL_LABEL);
- createEReference(controlLabelEClass, CONTROL_LABEL__ORIGINAL_VALUE);
-
- standardControlLabelEClass = createEClass(STANDARD_CONTROL_LABEL);
- createEAttribute(standardControlLabelEClass, STANDARD_CONTROL_LABEL__POPULATION_IDENTIFIER);
+ standardInterventionLabelEClass = createEClass(STANDARD_INTERVENTION_LABEL);
+ createEAttribute(standardInterventionLabelEClass, STANDARD_INTERVENTION_LABEL__POPULATION_IDENTIFIER);
controlGraphGeneratorEClass = createEClass(CONTROL_GRAPH_GENERATOR);
createEAttribute(controlGraphGeneratorEClass, CONTROL_GRAPH_GENERATOR__VACCINATION_FRACTION);
@@ -381,11 +293,11 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
createEAttribute(controlGraphGeneratorEClass, CONTROL_GRAPH_GENERATOR__POPULATION_IDENTIFIER);
createEAttribute(controlGraphGeneratorEClass, CONTROL_GRAPH_GENERATOR__LOCATION);
- controlLabelValueEClass = createEClass(CONTROL_LABEL_VALUE);
+ interventionLabelValueEClass = createEClass(INTERVENTION_LABEL_VALUE);
- standardControlLabelValueEClass = createEClass(STANDARD_CONTROL_LABEL_VALUE);
- createEAttribute(standardControlLabelValueEClass, STANDARD_CONTROL_LABEL_VALUE__VACCINATIONS);
- createEAttribute(standardControlLabelValueEClass, STANDARD_CONTROL_LABEL_VALUE__ISOLATIONS);
+ standardInterventionLabelValueEClass = createEClass(STANDARD_INTERVENTION_LABEL_VALUE);
+ createEAttribute(standardInterventionLabelValueEClass, STANDARD_INTERVENTION_LABEL_VALUE__VACCINATIONS);
+ createEAttribute(standardInterventionLabelValueEClass, STANDARD_INTERVENTION_LABEL_VALUE__ISOLATIONS);
}
/**
@@ -412,38 +324,27 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
setNsURI(eNS_URI);
// Obtain other dependent packages
- PredicatePackage thePredicatePackage = (PredicatePackage)EPackage.Registry.INSTANCE.getEPackage(PredicatePackage.eNS_URI);
- EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
- CommonPackage theCommonPackage = (CommonPackage)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI);
GraphPackage theGraphPackage = (GraphPackage)EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI);
+ EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
GraphgeneratorsPackage theGraphgeneratorsPackage = (GraphgeneratorsPackage)EPackage.Registry.INSTANCE.getEPackage(GraphgeneratorsPackage.eNS_URI);
+ CommonPackage theCommonPackage = (CommonPackage)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
- labelValueTestEClass.getESuperTypes().add(thePredicatePackage.getTest());
- controlLabelEClass.getESuperTypes().add(theGraphPackage.getNodeLabel());
- standardControlLabelEClass.getESuperTypes().add(this.getControlLabel());
+ interventionLabelEClass.getESuperTypes().add(theGraphPackage.getStaticNodeLabel());
+ standardInterventionLabelEClass.getESuperTypes().add(this.getInterventionLabel());
controlGraphGeneratorEClass.getESuperTypes().add(theGraphgeneratorsPackage.getGraphGenerator());
- controlLabelValueEClass.getESuperTypes().add(theGraphPackage.getLabelValue());
- standardControlLabelValueEClass.getESuperTypes().add(this.getControlLabelValue());
+ interventionLabelValueEClass.getESuperTypes().add(theGraphPackage.getLabelValue());
+ standardInterventionLabelValueEClass.getESuperTypes().add(this.getInterventionLabelValue());
// Initialize classes and features; add operations and parameters
- initEClass(labelValueTestEClass, LabelValueTest.class, "LabelValueTest", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getLabelValueTest_ModelName(), theEcorePackage.getEString(), "modelName", null, 0, 1, LabelValueTest.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getLabelValueTest_TargetURI(), theCommonPackage.getURI(), "targetURI", null, 0, 1, LabelValueTest.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getLabelValueTest_State(), theEcorePackage.getEString(), "state", "incidence", 0, 1, LabelValueTest.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getLabelValueTest_Threshold(), theEcorePackage.getEDouble(), "threshold", "100", 0, 1, LabelValueTest.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getLabelValueTest_Predicate(), theEcorePackage.getEString(), "predicate", ">", 0, 1, LabelValueTest.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getLabelValueTest_PopulationIdentifier(), theEcorePackage.getEString(), "populationIdentifier", "human", 0, 1, LabelValueTest.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(controlLabelEClass, ControlLabel.class, "ControlLabel", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getControlLabel_OriginalValue(), theGraphPackage.getLabelValue(), null, "originalValue", null, 1, 1, ControlLabel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(interventionLabelEClass, InterventionLabel.class, "InterventionLabel", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEClass(standardControlLabelEClass, StandardControlLabel.class, "StandardControlLabel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getStandardControlLabel_PopulationIdentifier(), theEcorePackage.getEString(), "populationIdentifier", "human", 0, 1, StandardControlLabel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(standardInterventionLabelEClass, StandardInterventionLabel.class, "StandardInterventionLabel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getStandardInterventionLabel_PopulationIdentifier(), theEcorePackage.getEString(), "populationIdentifier", "human", 0, 1, StandardInterventionLabel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(controlGraphGeneratorEClass, ControlGraphGenerator.class, "ControlGraphGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getControlGraphGenerator_VaccinationFraction(), theEcorePackage.getEDouble(), "vaccinationFraction", "0.0", 0, 1, ControlGraphGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -451,11 +352,11 @@ public class InterventionsPackageImpl extends EPackageImpl implements Interventi
initEAttribute(getControlGraphGenerator_PopulationIdentifier(), theEcorePackage.getEString(), "populationIdentifier", "human", 0, 1, ControlGraphGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getControlGraphGenerator_Location(), theCommonPackage.getURI(), "location", null, 0, 1, ControlGraphGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEClass(controlLabelValueEClass, ControlLabelValue.class, "ControlLabelValue", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEClass(interventionLabelValueEClass, InterventionLabelValue.class, "InterventionLabelValue", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEClass(standardControlLabelValueEClass, StandardControlLabelValue.class, "StandardControlLabelValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getStandardControlLabelValue_Vaccinations(), theEcorePackage.getEDouble(), "vaccinations", null, 0, 1, StandardControlLabelValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getStandardControlLabelValue_Isolations(), theEcorePackage.getEDouble(), "isolations", null, 0, 1, StandardControlLabelValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(standardInterventionLabelValueEClass, StandardInterventionLabelValue.class, "StandardInterventionLabelValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getStandardInterventionLabelValue_Vaccinations(), theEcorePackage.getEDouble(), "vaccinations", null, 0, 1, StandardInterventionLabelValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getStandardInterventionLabelValue_Isolations(), theEcorePackage.getEDouble(), "isolations", null, 0, 1, StandardInterventionLabelValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
diff --git a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/LabelValueTestImpl.java b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/LabelValueTestImpl.java
deleted file mode 100644
index 847ba74e9..000000000
--- a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/LabelValueTestImpl.java
+++ /dev/null
@@ -1,561 +0,0 @@
-package org.eclipse.stem.interventions.impl;
-
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.common.util.URI;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.stem.core.graph.DynamicLabel;
-import org.eclipse.stem.core.graph.Graph;
-import org.eclipse.stem.core.graph.LabelValue;
-import org.eclipse.stem.core.graph.Node;
-import org.eclipse.stem.core.graph.NodeLabel;
-import org.eclipse.stem.core.model.Decorator;
-import org.eclipse.stem.core.model.STEMTime;
-import org.eclipse.stem.core.predicate.impl.TestImpl;
-import org.eclipse.stem.definitions.LocationUtility;
-import org.eclipse.stem.diseasemodels.standard.DiseaseModel;
-import org.eclipse.stem.diseasemodels.standard.DiseaseModelLabel;
-
-import org.eclipse.stem.interventions.InterventionsPackage;
-import org.eclipse.stem.interventions.LabelValueTest;
-import org.eclipse.stem.populationmodels.standard.PopulationModel;
-import org.eclipse.stem.populationmodels.standard.PopulationModelLabel;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Label Value Test</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.stem.interventions.impl.LabelValueTestImpl#getModelName <em>Model Name</em>}</li>
- * <li>{@link org.eclipse.stem.interventions.impl.LabelValueTestImpl#getTargetURI <em>Target URI</em>}</li>
- * <li>{@link org.eclipse.stem.interventions.impl.LabelValueTestImpl#getState <em>State</em>}</li>
- * <li>{@link org.eclipse.stem.interventions.impl.LabelValueTestImpl#getThreshold <em>Threshold</em>}</li>
- * <li>{@link org.eclipse.stem.interventions.impl.LabelValueTestImpl#getPredicate <em>Predicate</em>}</li>
- * <li>{@link org.eclipse.stem.interventions.impl.LabelValueTestImpl#getPopulationIdentifier <em>Population Identifier</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class LabelValueTestImpl extends TestImpl implements LabelValueTest {
- /**
- * The default value of the '{@link #getModelName() <em>Model Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getModelName()
- * @generated
- * @ordered
- */
- protected static final String MODEL_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getModelName() <em>Model Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getModelName()
- * @generated
- * @ordered
- */
- protected String modelName = MODEL_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTargetURI() <em>Target URI</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetURI()
- * @generated
- * @ordered
- */
- protected static final URI TARGET_URI_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTargetURI() <em>Target URI</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetURI()
- * @generated
- * @ordered
- */
- protected URI targetURI = TARGET_URI_EDEFAULT;
-
- /**
- * The default value of the '{@link #getState() <em>State</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getState()
- * @generated
- * @ordered
- */
- protected static final String STATE_EDEFAULT = "incidence";
-
- /**
- * The cached value of the '{@link #getState() <em>State</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getState()
- * @generated
- * @ordered
- */
- protected String state = STATE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getThreshold() <em>Threshold</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getThreshold()
- * @generated
- * @ordered
- */
- protected static final double THRESHOLD_EDEFAULT = 100.0;
-
- /**
- * The cached value of the '{@link #getThreshold() <em>Threshold</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getThreshold()
- * @generated
- * @ordered
- */
- protected double threshold = THRESHOLD_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPredicate() <em>Predicate</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPredicate()
- * @generated
- * @ordered
- */
- protected static final String PREDICATE_EDEFAULT = ">";
-
- /**
- * The cached value of the '{@link #getPredicate() <em>Predicate</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPredicate()
- * @generated
- * @ordered
- */
- protected String predicate = PREDICATE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPopulationIdentifier() <em>Population Identifier</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPopulationIdentifier()
- * @generated
- * @ordered
- */
- protected static final String POPULATION_IDENTIFIER_EDEFAULT = "human";
-
- /**
- * The cached value of the '{@link #getPopulationIdentifier() <em>Population Identifier</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPopulationIdentifier()
- * @generated
- * @ordered
- */
- protected String populationIdentifier = POPULATION_IDENTIFIER_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected LabelValueTestImpl() {
- super();
- }
-
-
- Set<LabelValue> labelValueCache;
- EAttribute attribute;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public boolean evaluate(STEMTime time, long timerPeriod, Decorator action, Graph graph) {
- // First find the region (or set of regions contained) by the targetISOKey
-
- if(labelValueCache == null)
- labelValueCache = this.findLabelValues(graph);
-
- if(labelValueCache == null) return false; // Unable to find the disease or other problem
- double totalCount = 0.0;
-
- for(LabelValue currentValue:labelValueCache) {
- double val = (Double)currentValue.eGet(attribute);
- totalCount += val;
- }
-
- // Check threshold
-
- if(this.getPredicate().equals("=") && totalCount == this.getThreshold())
- return true;
- else if(this.getPredicate().equals(">") && totalCount > this.getThreshold())
- return true;
- else if(this.getPredicate().equals("<") && totalCount < this.getThreshold())
- return true;
- else if(this.getPredicate().equals(">=") && totalCount >= this.getThreshold())
- return true;
- else if(this.getPredicate().equals("<=") && totalCount <= this.getThreshold())
- return true;
-
- return false;
- }
-
- Set<LabelValue> findLabelValues(Graph graph) {
-
- HashSet<LabelValue> returnValue = new HashSet<LabelValue>();
-
- final Node parent = graph.getNode(getTargetURI());
- Set<Node> children = LocationUtility.getAllChildren(parent);
- children.add(parent);
-
- // Find the matching disease/population model
-
- Decorator dec = null;
-
- for(Decorator d:graph.getDecorators()) {
- if(d instanceof DiseaseModel &&
- ((DiseaseModel)d).getDiseaseName().equals(this.getModelName()) ||
- d instanceof PopulationModel && ((PopulationModel)d).getName().equals(this.getModelName())) { dec = d;break;}
- }
-
- if(dec == null) // Not found
- return null;
-
- // Now find the matching disease label and add up the states
-
- for(Node region:children) {
- for(NodeLabel label : region.getLabels()) {
- if(!(label instanceof DynamicLabel)) continue;
- DynamicLabel dl = (DynamicLabel)label;
- if(dl.getDecorator().equals(dec) &&
- (dl instanceof DiseaseModelLabel && ((DiseaseModelLabel)dl).getPopulationModelLabel().getPopulationIdentifier().equals(this.getPopulationIdentifier())) ||
- (dl instanceof PopulationModelLabel && ((PopulationModelLabel)dl).getPopulationIdentifier().equals(this.getPopulationIdentifier()))) {
-
- LabelValue currentValue = dl.getCurrentValue();
- // Find the matching state
- for(EAttribute ea:currentValue.eClass().getEAllAttributes()) {
- EDataType esf =ea.getEAttributeType();
- if(!esf.getName().equals("EDouble")) continue;
- if(ea.getName().equals(this.getState())) {
- if(attribute == null) attribute = ea;
- returnValue.add(currentValue);
- break;
- }
- }
- }
- }
- }
-
- return returnValue;
- }
-
-
- /**
- * Reset the cache
- */
-
- @Override
- public void reset() {
- this.attribute = null;
- this.labelValueCache = null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return InterventionsPackage.Literals.LABEL_VALUE_TEST;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getModelName() {
- return modelName;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setModelName(String newModelName) {
- String oldModelName = modelName;
- modelName = newModelName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.LABEL_VALUE_TEST__MODEL_NAME, oldModelName, modelName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public URI getTargetURI() {
- return targetURI;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setTargetURI(URI newTargetURI) {
- URI oldTargetURI = targetURI;
- targetURI = newTargetURI;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.LABEL_VALUE_TEST__TARGET_URI, oldTargetURI, targetURI));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getState() {
- return state;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setState(String newState) {
- String oldState = state;
- state = newState;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.LABEL_VALUE_TEST__STATE, oldState, state));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public double getThreshold() {
- return threshold;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setThreshold(double newThreshold) {
- double oldThreshold = threshold;
- threshold = newThreshold;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.LABEL_VALUE_TEST__THRESHOLD, oldThreshold, threshold));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getPredicate() {
- return predicate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setPredicate(String newPredicate) {
- String oldPredicate = predicate;
- predicate = newPredicate;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.LABEL_VALUE_TEST__PREDICATE, oldPredicate, predicate));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getPopulationIdentifier() {
- return populationIdentifier;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setPopulationIdentifier(String newPopulationIdentifier) {
- String oldPopulationIdentifier = populationIdentifier;
- populationIdentifier = newPopulationIdentifier;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.LABEL_VALUE_TEST__POPULATION_IDENTIFIER, oldPopulationIdentifier, populationIdentifier));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case InterventionsPackage.LABEL_VALUE_TEST__MODEL_NAME:
- return getModelName();
- case InterventionsPackage.LABEL_VALUE_TEST__TARGET_URI:
- return getTargetURI();
- case InterventionsPackage.LABEL_VALUE_TEST__STATE:
- return getState();
- case InterventionsPackage.LABEL_VALUE_TEST__THRESHOLD:
- return getThreshold();
- case InterventionsPackage.LABEL_VALUE_TEST__PREDICATE:
- return getPredicate();
- case InterventionsPackage.LABEL_VALUE_TEST__POPULATION_IDENTIFIER:
- return getPopulationIdentifier();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case InterventionsPackage.LABEL_VALUE_TEST__MODEL_NAME:
- setModelName((String)newValue);
- return;
- case InterventionsPackage.LABEL_VALUE_TEST__TARGET_URI:
- setTargetURI((URI)newValue);
- return;
- case InterventionsPackage.LABEL_VALUE_TEST__STATE:
- setState((String)newValue);
- return;
- case InterventionsPackage.LABEL_VALUE_TEST__THRESHOLD:
- setThreshold((Double)newValue);
- return;
- case InterventionsPackage.LABEL_VALUE_TEST__PREDICATE:
- setPredicate((String)newValue);
- return;
- case InterventionsPackage.LABEL_VALUE_TEST__POPULATION_IDENTIFIER:
- setPopulationIdentifier((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case InterventionsPackage.LABEL_VALUE_TEST__MODEL_NAME:
- setModelName(MODEL_NAME_EDEFAULT);
- return;
- case InterventionsPackage.LABEL_VALUE_TEST__TARGET_URI:
- setTargetURI(TARGET_URI_EDEFAULT);
- return;
- case InterventionsPackage.LABEL_VALUE_TEST__STATE:
- setState(STATE_EDEFAULT);
- return;
- case InterventionsPackage.LABEL_VALUE_TEST__THRESHOLD:
- setThreshold(THRESHOLD_EDEFAULT);
- return;
- case InterventionsPackage.LABEL_VALUE_TEST__PREDICATE:
- setPredicate(PREDICATE_EDEFAULT);
- return;
- case InterventionsPackage.LABEL_VALUE_TEST__POPULATION_IDENTIFIER:
- setPopulationIdentifier(POPULATION_IDENTIFIER_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case InterventionsPackage.LABEL_VALUE_TEST__MODEL_NAME:
- return MODEL_NAME_EDEFAULT == null ? modelName != null : !MODEL_NAME_EDEFAULT.equals(modelName);
- case InterventionsPackage.LABEL_VALUE_TEST__TARGET_URI:
- return TARGET_URI_EDEFAULT == null ? targetURI != null : !TARGET_URI_EDEFAULT.equals(targetURI);
- case InterventionsPackage.LABEL_VALUE_TEST__STATE:
- return STATE_EDEFAULT == null ? state != null : !STATE_EDEFAULT.equals(state);
- case InterventionsPackage.LABEL_VALUE_TEST__THRESHOLD:
- return threshold != THRESHOLD_EDEFAULT;
- case InterventionsPackage.LABEL_VALUE_TEST__PREDICATE:
- return PREDICATE_EDEFAULT == null ? predicate != null : !PREDICATE_EDEFAULT.equals(predicate);
- case InterventionsPackage.LABEL_VALUE_TEST__POPULATION_IDENTIFIER:
- return POPULATION_IDENTIFIER_EDEFAULT == null ? populationIdentifier != null : !POPULATION_IDENTIFIER_EDEFAULT.equals(populationIdentifier);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (modelName: ");
- result.append(modelName);
- result.append(", targetURI: ");
- result.append(targetURI);
- result.append(", state: ");
- result.append(state);
- result.append(", threshold: ");
- result.append(threshold);
- result.append(", predicate: ");
- result.append(predicate);
- result.append(", populationIdentifier: ");
- result.append(populationIdentifier);
- result.append(')');
- return result.toString();
- }
-
-} //LabelValueTestImpl
diff --git a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardControlLabelImpl.java b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardInterventionLabelImpl.java
index 72e368f89..c712ee749 100644
--- a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardControlLabelImpl.java
+++ b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardInterventionLabelImpl.java
@@ -13,22 +13,22 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.stem.interventions.InterventionsPackage;
-import org.eclipse.stem.interventions.StandardControlLabel;
+import org.eclipse.stem.interventions.StandardInterventionLabel;
/**
* <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Standard Control Label</b></em>'.
+ * An implementation of the model object '<em><b>Standard Intervention Label</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.stem.interventions.impl.StandardControlLabelImpl#getPopulationIdentifier <em>Population Identifier</em>}</li>
+ * <li>{@link org.eclipse.stem.interventions.impl.StandardInterventionLabelImpl#getPopulationIdentifier <em>Population Identifier</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class StandardControlLabelImpl extends ControlLabelImpl implements StandardControlLabel {
+public class StandardInterventionLabelImpl extends InterventionLabelImpl implements StandardInterventionLabel {
/**
* The default value of the '{@link #getPopulationIdentifier() <em>Population Identifier</em>}' attribute.
* <!-- begin-user-doc -->
@@ -38,6 +38,7 @@ public class StandardControlLabelImpl extends ControlLabelImpl implements Standa
* @ordered
*/
protected static final String POPULATION_IDENTIFIER_EDEFAULT = "human";
+
/**
* The cached value of the '{@link #getPopulationIdentifier() <em>Population Identifier</em>}' attribute.
* <!-- begin-user-doc -->
@@ -53,7 +54,7 @@ public class StandardControlLabelImpl extends ControlLabelImpl implements Standa
* <!-- end-user-doc -->
* @generated
*/
- protected StandardControlLabelImpl() {
+ protected StandardInterventionLabelImpl() {
super();
}
@@ -64,7 +65,7 @@ public class StandardControlLabelImpl extends ControlLabelImpl implements Standa
*/
@Override
protected EClass eStaticClass() {
- return InterventionsPackage.Literals.STANDARD_CONTROL_LABEL;
+ return InterventionsPackage.Literals.STANDARD_INTERVENTION_LABEL;
}
/**
@@ -85,7 +86,7 @@ public class StandardControlLabelImpl extends ControlLabelImpl implements Standa
String oldPopulationIdentifier = populationIdentifier;
populationIdentifier = newPopulationIdentifier;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.STANDARD_CONTROL_LABEL__POPULATION_IDENTIFIER, oldPopulationIdentifier, populationIdentifier));
+ eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.STANDARD_INTERVENTION_LABEL__POPULATION_IDENTIFIER, oldPopulationIdentifier, populationIdentifier));
}
/**
@@ -96,7 +97,7 @@ public class StandardControlLabelImpl extends ControlLabelImpl implements Standa
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case InterventionsPackage.STANDARD_CONTROL_LABEL__POPULATION_IDENTIFIER:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL__POPULATION_IDENTIFIER:
return getPopulationIdentifier();
}
return super.eGet(featureID, resolve, coreType);
@@ -110,7 +111,7 @@ public class StandardControlLabelImpl extends ControlLabelImpl implements Standa
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case InterventionsPackage.STANDARD_CONTROL_LABEL__POPULATION_IDENTIFIER:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL__POPULATION_IDENTIFIER:
setPopulationIdentifier((String)newValue);
return;
}
@@ -125,7 +126,7 @@ public class StandardControlLabelImpl extends ControlLabelImpl implements Standa
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case InterventionsPackage.STANDARD_CONTROL_LABEL__POPULATION_IDENTIFIER:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL__POPULATION_IDENTIFIER:
setPopulationIdentifier(POPULATION_IDENTIFIER_EDEFAULT);
return;
}
@@ -140,7 +141,7 @@ public class StandardControlLabelImpl extends ControlLabelImpl implements Standa
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case InterventionsPackage.STANDARD_CONTROL_LABEL__POPULATION_IDENTIFIER:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL__POPULATION_IDENTIFIER:
return POPULATION_IDENTIFIER_EDEFAULT == null ? populationIdentifier != null : !POPULATION_IDENTIFIER_EDEFAULT.equals(populationIdentifier);
}
return super.eIsSet(featureID);
@@ -162,4 +163,4 @@ public class StandardControlLabelImpl extends ControlLabelImpl implements Standa
return result.toString();
}
-} //StandardControlLabelImpl
+} //StandardInterventionLabelImpl
diff --git a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardControlLabelValueImpl.java b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardInterventionLabelValueImpl.java
index 5348c7f3c..533142a6a 100644
--- a/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardControlLabelValueImpl.java
+++ b/org.eclipse.stem.interventions/src/org/eclipse/stem/interventions/impl/StandardInterventionLabelValueImpl.java
@@ -13,23 +13,23 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.stem.interventions.InterventionsPackage;
-import org.eclipse.stem.interventions.StandardControlLabelValue;
+import org.eclipse.stem.interventions.StandardInterventionLabelValue;
/**
* <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Standard Control Label Value</b></em>'.
+ * An implementation of the model object '<em><b>Standard Intervention Label Value</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.stem.interventions.impl.StandardControlLabelValueImpl#getVaccinations <em>Vaccinations</em>}</li>
- * <li>{@link org.eclipse.stem.interventions.impl.StandardControlLabelValueImpl#getIsolations <em>Isolations</em>}</li>
+ * <li>{@link org.eclipse.stem.interventions.impl.StandardInterventionLabelValueImpl#getVaccinations <em>Vaccinations</em>}</li>
+ * <li>{@link org.eclipse.stem.interventions.impl.StandardInterventionLabelValueImpl#getIsolations <em>Isolations</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class StandardControlLabelValueImpl extends ControlLabelValueImpl implements StandardControlLabelValue {
+public class StandardInterventionLabelValueImpl extends InterventionLabelValueImpl implements StandardInterventionLabelValue {
/**
* The default value of the '{@link #getVaccinations() <em>Vaccinations</em>}' attribute.
* <!-- begin-user-doc -->
@@ -75,7 +75,7 @@ public class StandardControlLabelValueImpl extends ControlLabelValueImpl impleme
* <!-- end-user-doc -->
* @generated
*/
- protected StandardControlLabelValueImpl() {
+ protected StandardInterventionLabelValueImpl() {
super();
}
@@ -86,7 +86,7 @@ public class StandardControlLabelValueImpl extends ControlLabelValueImpl impleme
*/
@Override
protected EClass eStaticClass() {
- return InterventionsPackage.Literals.STANDARD_CONTROL_LABEL_VALUE;
+ return InterventionsPackage.Literals.STANDARD_INTERVENTION_LABEL_VALUE;
}
/**
@@ -107,7 +107,7 @@ public class StandardControlLabelValueImpl extends ControlLabelValueImpl impleme
double oldVaccinations = vaccinations;
vaccinations = newVaccinations;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE__VACCINATIONS, oldVaccinations, vaccinations));
+ eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE__VACCINATIONS, oldVaccinations, vaccinations));
}
/**
@@ -128,7 +128,7 @@ public class StandardControlLabelValueImpl extends ControlLabelValueImpl impleme
double oldIsolations = isolations;
isolations = newIsolations;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE__ISOLATIONS, oldIsolations, isolations));
+ eNotify(new ENotificationImpl(this, Notification.SET, InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE__ISOLATIONS, oldIsolations, isolations));
}
/**
@@ -139,9 +139,9 @@ public class StandardControlLabelValueImpl extends ControlLabelValueImpl impleme
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE__VACCINATIONS:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE__VACCINATIONS:
return getVaccinations();
- case InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE__ISOLATIONS:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE__ISOLATIONS:
return getIsolations();
}
return super.eGet(featureID, resolve, coreType);
@@ -155,10 +155,10 @@ public class StandardControlLabelValueImpl extends ControlLabelValueImpl impleme
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE__VACCINATIONS:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE__VACCINATIONS:
setVaccinations((Double)newValue);
return;
- case InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE__ISOLATIONS:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE__ISOLATIONS:
setIsolations((Double)newValue);
return;
}
@@ -173,10 +173,10 @@ public class StandardControlLabelValueImpl extends ControlLabelValueImpl impleme
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE__VACCINATIONS:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE__VACCINATIONS:
setVaccinations(VACCINATIONS_EDEFAULT);
return;
- case InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE__ISOLATIONS:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE__ISOLATIONS:
setIsolations(ISOLATIONS_EDEFAULT);
return;
}
@@ -191,9 +191,9 @@ public class StandardControlLabelValueImpl extends ControlLabelValueImpl impleme
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE__VACCINATIONS:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE__VACCINATIONS:
return vaccinations != VACCINATIONS_EDEFAULT;
- case InterventionsPackage.STANDARD_CONTROL_LABEL_VALUE__ISOLATIONS:
+ case InterventionsPackage.STANDARD_INTERVENTION_LABEL_VALUE__ISOLATIONS:
return isolations != ISOLATIONS_EDEFAULT;
}
return super.eIsSet(featureID);
@@ -217,4 +217,4 @@ public class StandardControlLabelValueImpl extends ControlLabelValueImpl impleme
return result.toString();
}
-} //StandardControlLabelValueImpl
+} //StandardInterventionLabelValueImpl

Back to the top