org.eclipse.ohf.stem.diseasemodels.standard.impl
Class StandardDiseaseModelImpl

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended by org.eclipse.emf.ecore.impl.EObjectImpl
              extended by org.eclipse.ohf.stem.core.common.impl.IdentifiableImpl
                  extended by org.eclipse.ohf.stem.core.model.impl.DecoratorImpl
                      extended by org.eclipse.ohf.stem.core.model.impl.NodeDecoratorImpl
                          extended by org.eclipse.ohf.stem.diseasemodels.standard.impl.DiseaseModelImpl
                              extended by org.eclipse.ohf.stem.diseasemodels.standard.impl.StandardDiseaseModelImpl
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject, Identifiable, SanityChecker, Decorator, NodeDecorator, DiseaseModel, StandardDiseaseModel
Direct Known Subclasses:
SIImpl

public abstract class StandardDiseaseModelImpl
extends DiseaseModelImpl
implements StandardDiseaseModel

An implementation of the model object 'Disease Model'.

The following features are implemented:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends java.lang.Object & org.eclipse.emf.common.notify.Adapter>
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
org.eclipse.emf.ecore.InternalEObject.EStore
 
Field Summary
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
ELAST_EOBJECT_FLAG
 
Fields inherited from interface org.eclipse.ohf.stem.diseasemodels.standard.StandardDiseaseModel
URI_TYPE_STANDARD_DISEASEMODEL_SEGMENT
 
Fields inherited from interface org.eclipse.ohf.stem.diseasemodels.standard.DiseaseModel
URI_TYPE_DISEASEMODEL_SEGMENT
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Method Summary
 void addToTotalArea(double area)
           
 void addToTotalPopulationCount(double populationCount)
           
 double computeBirths(StandardDiseaseModelLabel currentLabel, long timeDelta)
          Compute the number of new population members that are born.
abstract  StandardDiseaseModelLabelValue computeDeaths(StandardDiseaseModelLabel currentLabel, long timeDelta)
           
 double computeTotalPopulationCountReciprocal()
           
abstract  StandardDiseaseModelLabelValue computeTransitions(StandardDiseaseModelLabelValue currentState, StandardDiseaseModelLabel diseaseLabel, long timeDelta)
           
 java.lang.Object eGet(int featureID, boolean resolve, boolean coreType)
           
 boolean eIsSet(int featureID)
           
 void eSet(int featureID, java.lang.Object newValue)
           
 void eUnset(int featureID)
           
 double getTotalArea()
           
 double getTotalPopulationCount()
           
 double getTotalPopulationCountReciprocal()
           
 void initializeDiseaseState(DiseaseModelLabel diseaseModelLabel)
          Here we compute and set the ratio between the total area and the area used for this DiseaseModelLabel.
 DiseaseModelState initializeDiseaseState(DiseaseModelState diseaseModelState, DiseaseModelLabel diseaseModelLabel)
           
 void resetLabels()
           
 boolean sane()
           
 void setTotalArea(double newTotalArea)
           
 void setTotalPopulationCount(double newTotalPopulationCount)
           
 java.lang.String toString()
           
 void updateLabels(STEMTime time, long timeDelta)
           
 
Methods inherited from class org.eclipse.ohf.stem.diseasemodels.standard.impl.DiseaseModelImpl
createDiseaseModelLabel, createDiseaseModelLabelValue, createDiseaseModelState, createInfector, decorateGraph, getAdjustedBackgroundMortalityRate, getBackgroundMortalityRate, getDiseaseName, getPopulationIdentifier, getTimePeriod, setBackgroundMortalityRate, setDiseaseName, setPopulationIdentifier, setTimePeriod
 
Methods inherited from class org.eclipse.ohf.stem.core.model.impl.DecoratorImpl
basicSetGraph, eBasicRemoveFromContainerFeature, eInverseAdd, eInverseRemove, getGraph, getLabelsToUpdate, setGraph
 
Methods inherited from class org.eclipse.ohf.stem.core.common.impl.IdentifiableImpl
basicSetDublinCore, getDublinCore, getTypeURI, getURI, setDublinCore, setTypeURI, setURI
 
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eIsProxy, eSetClass, eSetDeliver, eSetProxyURI
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicSetContainer, eContainer, eContainingFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eInternalResource, eInverseAdd, eInverseRemove, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eResolveProxy, eResource, eSet, eSetResource, eSetStore, eSetting, eStore, eUnset, eURIFragmentSegment, eVirtualGet, eVirtualGet, eVirtualIsSet, eVirtualSet, eVirtualUnset
 
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eNotificationRequired, eNotify
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.ohf.stem.diseasemodels.standard.DiseaseModel
createDiseaseModelLabel, createDiseaseModelLabelValue, createDiseaseModelState, createInfector, getAdjustedBackgroundMortalityRate, getBackgroundMortalityRate, getDiseaseName, getPopulationIdentifier, getTimePeriod, setBackgroundMortalityRate, setDiseaseName, setPopulationIdentifier, setTimePeriod
 
Methods inherited from interface org.eclipse.ohf.stem.core.model.Decorator
decorateGraph, getGraph, getLabelsToUpdate, setGraph
 
Methods inherited from interface org.eclipse.ohf.stem.core.common.Identifiable
getDublinCore, getTypeURI, getURI, setDublinCore, setTypeURI, setURI
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

Method Detail

getTotalPopulationCount

public double getTotalPopulationCount()

Specified by:
getTotalPopulationCount in interface StandardDiseaseModel
Returns:
the total number of population members this disease model is processing
See Also:
StandardDiseaseModel.setTotalPopulationCount(double), StandardDiseaseModel.addToTotalPopulationCount(double)

setTotalPopulationCount

public void setTotalPopulationCount(double newTotalPopulationCount)

Specified by:
setTotalPopulationCount in interface StandardDiseaseModel
Parameters:
newTotalPopulationCount - the new value of the 'Total Population Count' attribute.
See Also:
StandardDiseaseModel.getTotalPopulationCount()

getTotalPopulationCountReciprocal

public double getTotalPopulationCountReciprocal()

Specified by:
getTotalPopulationCountReciprocal in interface StandardDiseaseModel
Returns:
the reciprocal of the total population count.
See Also:
#computeTotalPopulationReciprocal()

getTotalArea

public double getTotalArea()

Specified by:
getTotalArea in interface StandardDiseaseModel
Returns:
the total area (km^2) occupied by the population whose disease state is processed by this StandardDiseseModel
See Also:
StandardDiseaseModel.addToTotalArea(double), StandardDiseaseModel.setTotalArea(double)

setTotalArea

public void setTotalArea(double newTotalArea)

Specified by:
setTotalArea in interface StandardDiseaseModel
Parameters:
newTotalArea - the new value of the 'Total Area' attribute.
See Also:
StandardDiseaseModel.getTotalArea()

addToTotalPopulationCount

public void addToTotalPopulationCount(double populationCount)

Specified by:
addToTotalPopulationCount in interface StandardDiseaseModel
Parameters:
populationCount - the number of population members to add to the total
See Also:
StandardDiseaseModel.getTotalPopulationCount(), StandardDiseaseModel.setTotalPopulationCount(double)

computeTotalPopulationCountReciprocal

public double computeTotalPopulationCountReciprocal()

Specified by:
computeTotalPopulationCountReciprocal in interface StandardDiseaseModel
Returns:
1/getTotalPopulationCount()
See Also:
StandardDiseaseModel.getTotalPopulationCountReciprocal()

addToTotalArea

public void addToTotalArea(double area)

Specified by:
addToTotalArea in interface StandardDiseaseModel
Parameters:
area - the area to add (km^2)
See Also:
StandardDiseaseModel.getTotalArea(), StandardDiseaseModel.setTotalArea(double)

eGet

public java.lang.Object eGet(int featureID,
                             boolean resolve,
                             boolean coreType)

Specified by:
eGet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eGet in class DiseaseModelImpl
Returns:

eSet

public void eSet(int featureID,
                 java.lang.Object newValue)

Specified by:
eSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eSet in class DiseaseModelImpl
newValue -

eUnset

public void eUnset(int featureID)

Specified by:
eUnset in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eUnset in class DiseaseModelImpl
Parameters:
featureID -

eIsSet

public boolean eIsSet(int featureID)

Specified by:
eIsSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eIsSet in class DiseaseModelImpl
Returns:

updateLabels

public void updateLabels(STEMTime time,
                         long timeDelta)
Description copied from class: DecoratorImpl

Specified by:
updateLabels in interface Decorator
Overrides:
updateLabels in class DecoratorImpl
Parameters:
time - the time to be used when determining the changes to be made to the Graph
See Also:
org.eclipse.ohf.stem.core.model.impl.DecoratorImpl#updateLabels(org.eclipse.ohf.stem.core.graph.Graph, org.eclipse.ohf.stem.core.model.STEMTime)

computeBirths

public double computeBirths(StandardDiseaseModelLabel currentLabel,
                            long timeDelta)
Compute the number of new population members that are born. We assume that the birth rate is the same as the base mortality rate. This assumes that the population was relatively stable before the disease. The number of births could be less than the number of deaths however when the infectious mortality rate is included when computing the number of deaths.

Parameters:
currentLabel - the current disease model label
timeDelta - the time period (milliseconds) over which the population members are born
Returns:
the number of new population members that are created during the time delta that enter the Susceptible state.

initializeDiseaseState

public DiseaseModelState initializeDiseaseState(DiseaseModelState diseaseModelState,
                                                DiseaseModelLabel diseaseModelLabel)
Description copied from class: DiseaseModelImpl

Specified by:
initializeDiseaseState in interface DiseaseModel
Specified by:
initializeDiseaseState in class DiseaseModelImpl
Parameters:
diseaseModelState - the state information to be initialized
diseaseModelLabel - the label to use to initialize the state information
Returns:
See Also:
DiseaseModelImpl.initializeDiseaseState(org.eclipse.ohf.stem.diseasemodels.standard.DiseaseModelState, org.eclipse.ohf.stem.diseasemodels.standard.DiseaseModelLabel)

initializeDiseaseState

public void initializeDiseaseState(DiseaseModelLabel diseaseModelLabel)
Here we compute and set the ratio between the total area and the area used for this DiseaseModelLabel. This value is used to determine the transmission scale factor.

Specified by:
initializeDiseaseState in interface DiseaseModel
Specified by:
initializeDiseaseState in class DiseaseModelImpl
Parameters:
diseaseModelLabel - the label to use to initialize the state information
See Also:
computeTransitions(StandardDiseaseModelLabelValue, StandardDiseaseModelLabel, long), DiseaseModelImpl.initializeDiseaseState(org.eclipse.ohf.stem.diseasemodels.standard.DiseaseModelLabel)

computeTransitions

public abstract StandardDiseaseModelLabelValue computeTransitions(StandardDiseaseModelLabelValue currentState,
                                                                  StandardDiseaseModelLabel diseaseLabel,
                                                                  long timeDelta)
Parameters:
currentState - the current state of the population
diseaseLabel - the disease label for which the state transitions are being computed.
timeDelta - the time period (milliseconds) over which the population members transition to new states
Returns:
a disease state label value that contains the number of population members in each state that transition to the next state (e.g., S->E->I->R->S).

computeDeaths

public abstract StandardDiseaseModelLabelValue computeDeaths(StandardDiseaseModelLabel currentLabel,
                                                             long timeDelta)
Parameters:
currentLabel - the current label of the disease model
timeDelta - the time period over which the population members die
Returns:
the disease state label value that represents the number of deaths in each state.

resetLabels

public void resetLabels()
Description copied from class: DecoratorImpl

Specified by:
resetLabels in interface Decorator
Overrides:
resetLabels in class DecoratorImpl

toString

public java.lang.String toString()

Overrides:
toString in class DiseaseModelImpl
Returns:

sane

public boolean sane()
Description copied from class: IdentifiableImpl

Specified by:
sane in interface Identifiable
Specified by:
sane in interface SanityChecker
Overrides:
sane in class DiseaseModelImpl
Returns:
true if the instance is "sane", false otherwise.
See Also:
DiseaseModelImpl.sane()