org.eclipse.ohf.stem.definitions.labels.impl
Class TransportRelationshipLabelImpl

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.graph.impl.LabelImpl
                      extended by org.eclipse.ohf.stem.core.graph.impl.DynamicLabelImpl
                          extended by org.eclipse.ohf.stem.core.graph.impl.DynamicEdgeLabelImpl
                              extended by org.eclipse.ohf.stem.definitions.labels.impl.TransportRelationshipLabelImpl
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject, Identifiable, SanityChecker, DynamicEdgeLabel, DynamicLabel, EdgeLabel, Label, TransportRelationshipLabel

public class TransportRelationshipLabelImpl
extends DynamicEdgeLabelImpl
implements TransportRelationshipLabel

An implementation of the model object 'Transport Relationship Label'.

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
static java.lang.String copyright
           
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
ELAST_EOBJECT_FLAG
 
Fields inherited from interface org.eclipse.ohf.stem.core.graph.DynamicLabel
URI_TYPE_DYNAMIC_LABEL, URI_TYPE_DYNAMIC_LABEL_SEGMENT
 
Fields inherited from interface org.eclipse.ohf.stem.core.graph.Label
URI_TYPE_LABEL, URI_TYPE_LABEL_SEGMENT
 
Fields inherited from interface org.eclipse.ohf.stem.core.graph.Label
URI_TYPE_LABEL, URI_TYPE_LABEL_SEGMENT
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Method Summary
static Edge createTransportRelationship(Node nodeA, Node nodeB, TransportMode transportMode, java.lang.String transportIdentifier, java.lang.String populationIdentifier, long rateTimePeriod, int maximumCapacity)
          Create an edge the represents a reflexive transportation relationship between two nodes.
static Edge createTransportRelationship(Node nodeA, Node nodeB, TransportMode transportMode, java.lang.String transportIdentifier, java.lang.String populationIdentifier, long rateTimePeriod, int maximumCapacity, boolean directed)
          Create an edge the represents a reflexive transportation relationship between two nodes.
static Edge createTransportRelationship(Node nodeA, Node nodeB, TransportMode transportMode, java.lang.String transportIdentifier, java.lang.String populationIdentifier, long rateTimePeriod, int maximumDepartureCapacity, int maximumCapacity, long transitTime, long startUpDelay)
          Create an edge the represents a reflexive transportation relationship between two nodes.
static Edge createTransportRelationship(Node nodeA, Node nodeB, TransportMode transportMode, java.lang.String transportIdentifier, java.lang.String populationIdentifier, long rateTimePeriod, int maximumDepartureCapacity, int maximumCapacity, long transitTime, long startUpDelay, boolean directed)
          Create an edge the represents a transportation relationship between two nodes.
 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)
           
 int getCapacity()
           
 TransportRelationshipLabelValue getCurrentTransportRelationshipLabelValue()
           
 int getDepartureCapacity()
           
 int getMaximumCapacity()
           
 int getMaximumDepartureCapacity()
           
 java.lang.String getPopulationIdentifier()
           
 long getRateTimePeriod()
           
 long getStartUpDelay()
           
 long getTransitTime()
           
static java.util.List<Edge> getTransportEdgesFromNode(Node node, java.lang.String populationIdentifier)
           
static java.util.List<Edge> getTransportEdgesToNode(Node node, java.lang.String populationIdentifier)
           
 java.lang.String getTransportIdentifier()
           
 TransportMode getTransportMode()
           
 org.eclipse.emf.common.util.EList receive(Node here, STEMTime currentTime)
          Receive some travelers.
 void reset()
          Set the next value valid flag to false.
 boolean sane()
           
 void send(Node here, org.eclipse.emf.ecore.EObject departees)
          Send a representation of population members to be "transported" from the Node here to the other Node in the relationship.
 void setMaximumCapacity(int newMaximumCapacity)
           
 void setMaximumDepartureCapacity(int newMaximumDepartureCapacity)
           
 void setPopulationIdentifier(java.lang.String newPopulationIdentifier)
           
 void setRateTimePeriod(long newRateTimePeriod)
           
 void setStartUpDelay(long newStartUpDelay)
           
 void setTransitTime(long newTransitTime)
           
 void setTransportIdentifier(java.lang.String newTransportIdentifier)
           
 void setTransportMode(TransportMode newTransportMode)
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.ohf.stem.core.graph.impl.DynamicEdgeLabelImpl
basicSetEdge, eBaseStructuralFeatureID, eBasicRemoveFromContainerFeature, eDerivedStructuralFeatureID, eInverseAdd, eInverseRemove, getEdge, getIdentifiable, setEdge, setIdentifiable
 
Methods inherited from class org.eclipse.ohf.stem.core.graph.impl.DynamicLabelImpl
basicGetDecorator, basicSetDecorator, basicSetNextValue, getDecorator, getNextValue, isNextValueValid, setDecorator, setNextValue, setNextValueValid, switchToNextValue
 
Methods inherited from class org.eclipse.ohf.stem.core.graph.impl.LabelImpl
basicGetIdentifiable, basicSetCurrentValue, getCurrentValue, getURIOfIdentifiableToBeLabeled, setCurrentValue, setURIOfIdentifiableToBeLabeled
 
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, eBasicRemoveFromContainer, eBasicSetContainer, eContainer, eContainingFeature, eContainmentFeature, eContains, eContents, eCrossReferences, 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.core.graph.DynamicLabel
getDecorator, getNextValue, isNextValueValid, setDecorator, setNextValue, setNextValueValid, switchToNextValue
 
Methods inherited from interface org.eclipse.ohf.stem.core.graph.Label
getCurrentValue, getIdentifiable, getURIOfIdentifiableToBeLabeled, setCurrentValue, setIdentifiable, setURIOfIdentifiableToBeLabeled
 
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.ohf.stem.core.graph.EdgeLabel
getEdge, setEdge
 
Methods inherited from interface org.eclipse.ohf.stem.core.graph.Label
getCurrentValue, getIdentifiable, getURIOfIdentifiableToBeLabeled, setCurrentValue, setIdentifiable, setURIOfIdentifiableToBeLabeled
 
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
 

Field Detail

copyright

public static final java.lang.String copyright

See Also:
Constant Field Values
Method Detail

createTransportRelationship

public static Edge createTransportRelationship(Node nodeA,
                                               Node nodeB,
                                               TransportMode transportMode,
                                               java.lang.String transportIdentifier,
                                               java.lang.String populationIdentifier,
                                               long rateTimePeriod,
                                               int maximumCapacity)
Create an edge the represents a reflexive transportation relationship between two nodes.

Parameters:
nodeA - the first node
nodeB - the second node
transportMode - the transportation mode
transportIdentifier - the identifier of the transportion (e.g., road name)
populationIdentifier - the population being transported
Returns:

createTransportRelationship

public static Edge createTransportRelationship(Node nodeA,
                                               Node nodeB,
                                               TransportMode transportMode,
                                               java.lang.String transportIdentifier,
                                               java.lang.String populationIdentifier,
                                               long rateTimePeriod,
                                               int maximumCapacity,
                                               boolean directed)
Create an edge the represents a reflexive transportation relationship between two nodes.

Parameters:
nodeA - the first node
nodeB - the second node
transportMode - the transportation mode
transportIdentifier - the identifier of the transportion (e.g., road name)
populationIdentifier - the population being transported
Returns:

createTransportRelationship

public static Edge createTransportRelationship(Node nodeA,
                                               Node nodeB,
                                               TransportMode transportMode,
                                               java.lang.String transportIdentifier,
                                               java.lang.String populationIdentifier,
                                               long rateTimePeriod,
                                               int maximumDepartureCapacity,
                                               int maximumCapacity,
                                               long transitTime,
                                               long startUpDelay)
Create an edge the represents a reflexive transportation relationship between two nodes.

Parameters:
nodeA - the first node
nodeB - the second node
transportMode - the transportation mode
transportIdentifier - the identifier of the transportion (e.g., road name)
populationIdentifier - the population being transported
populationCount - the number of population members
timePeriod - the unit of time the population count is transported in (milliseconds)
Returns:

createTransportRelationship

public static Edge createTransportRelationship(Node nodeA,
                                               Node nodeB,
                                               TransportMode transportMode,
                                               java.lang.String transportIdentifier,
                                               java.lang.String populationIdentifier,
                                               long rateTimePeriod,
                                               int maximumDepartureCapacity,
                                               int maximumCapacity,
                                               long transitTime,
                                               long startUpDelay,
                                               boolean directed)
Create an edge the represents a transportation relationship between two nodes.

Parameters:
nodeA - the first node
nodeB - the second node
transportMode - the transportation mode
transportIdentifier - the identifier of the transportion (e.g., road name)
populationIdentifier - the population being transported
populationCount - the number of population members
rateTimePeriod - the unit of time the population count is transported in (milliseconds)
directed - if true then the relationship is only from nodeA to nodeB, and not the other way around. This means things move from nodeA to nodeB, but not in the other direction.
Returns:

getTransportMode

public TransportMode getTransportMode()

Specified by:
getTransportMode in interface TransportRelationshipLabel

setTransportMode

public void setTransportMode(TransportMode newTransportMode)

Specified by:
setTransportMode in interface TransportRelationshipLabel
Parameters:
newTransportMode - the new value of the 'Transport Mode' attribute.
See Also:
TransportMode, TransportRelationshipLabel.getTransportMode()

getPopulationIdentifier

public java.lang.String getPopulationIdentifier()

Specified by:
getPopulationIdentifier in interface TransportRelationshipLabel

setPopulationIdentifier

public void setPopulationIdentifier(java.lang.String newPopulationIdentifier)

Specified by:
setPopulationIdentifier in interface TransportRelationshipLabel
Parameters:
newPopulationIdentifier - the new value of the 'Population Identifier' attribute.
See Also:
TransportRelationshipLabel.getPopulationIdentifier()

getTransportIdentifier

public java.lang.String getTransportIdentifier()

Specified by:
getTransportIdentifier in interface TransportRelationshipLabel
Returns:
a String that identifiers the specific transportation instance. For example, this might be the name of a road.

setTransportIdentifier

public void setTransportIdentifier(java.lang.String newTransportIdentifier)

Specified by:
setTransportIdentifier in interface TransportRelationshipLabel
Parameters:
newTransportIdentifier - the new value of the 'Transport Identifier' attribute.
See Also:
TransportRelationshipLabel.getTransportIdentifier()

getCurrentTransportRelationshipLabelValue

public TransportRelationshipLabelValue getCurrentTransportRelationshipLabelValue()

Specified by:
getCurrentTransportRelationshipLabelValue in interface TransportRelationshipLabel
Returns:
the current transport relationship value

getRateTimePeriod

public long getRateTimePeriod()

Specified by:
getRateTimePeriod in interface TransportRelationshipLabel
Returns:
the number of milliseconds it takes to transport the that defines the rate at which population members are transported. (Milliseconds)
See Also:
STEMTime

setRateTimePeriod

public void setRateTimePeriod(long newRateTimePeriod)

Specified by:
setRateTimePeriod in interface TransportRelationshipLabel
Parameters:
newRateTimePeriod - the new value of the 'Rate Time Period' attribute.
See Also:
TransportRelationshipLabel.getRateTimePeriod()

getDepartureCapacity

public int getDepartureCapacity()

Specified by:
getDepartureCapacity in interface TransportRelationshipLabel
Returns:
the current number of population members that can depart given the currently available departure capacity.
See Also:
TransportRelationshipLabelValue.getAvailableDepartureCapacityProportion(), TransportRelationshipLabel.getMaximumDepartureCapacity()

getMaximumDepartureCapacity

public int getMaximumDepartureCapacity()

Specified by:
getMaximumDepartureCapacity in interface TransportRelationshipLabel
Returns:
the maximum number of population members that can depart using the transportation mode/identifer each time period
See Also:
#getTimePeriod(), TransportRelationshipLabel.getMaximumCapacity(), TransportRelationshipLabel.getStartUpDelay()

setMaximumDepartureCapacity

public void setMaximumDepartureCapacity(int newMaximumDepartureCapacity)

Specified by:
setMaximumDepartureCapacity in interface TransportRelationshipLabel
Parameters:
newMaximumDepartureCapacity - the new value of the 'Maximum Departure Capacity' attribute.
See Also:
TransportRelationshipLabel.getMaximumDepartureCapacity()

getCapacity

public int getCapacity()

Specified by:
getCapacity in interface TransportRelationshipLabel
Returns:
the current number of population members that can be in transit at any one time.
See Also:
TransportRelationshipLabelValue.getAvailableDepartureCapacityProportion(), TransportRelationshipLabel.getMaximumCapacity()

getMaximumCapacity

public int getMaximumCapacity()

Specified by:
getMaximumCapacity in interface TransportRelationshipLabel
Returns:
the total maximum number of population members that can be in transit at any one time.
See Also:
#getTimePeriod(), TransportRelationshipLabel.getCapacity(), TransportRelationshipLabel.getStartUpDelay()

setMaximumCapacity

public void setMaximumCapacity(int newMaximumCapacity)

Specified by:
setMaximumCapacity in interface TransportRelationshipLabel
Parameters:
newMaximumCapacity - the new value of the 'Maximum Capacity' attribute.
See Also:
TransportRelationshipLabel.getMaximumCapacity()

getTransitTime

public long getTransitTime()

Specified by:
getTransitTime in interface TransportRelationshipLabel
Returns:
the number of milliseconds it takes population members to travel from one Node to another using the the type of transportation represented by the relationship.

setTransitTime

public void setTransitTime(long newTransitTime)

Specified by:
setTransitTime in interface TransportRelationshipLabel
Parameters:
newTransitTime - the new value of the 'Transit Time' attribute.
See Also:
TransportRelationshipLabel.getTransitTime()

getStartUpDelay

public long getStartUpDelay()

Specified by:
getStartUpDelay in interface TransportRelationshipLabel
Returns:
the number of milliseconds it takes the transportation capacity to linearly increase from zero to maximum capacity. The departure capacity also increases at this rate from 0 to its maximum.
See Also:
TransportRelationshipLabel.getMaximumCapacity(), TransportRelationshipLabel.getDepartureCapacity()

setStartUpDelay

public void setStartUpDelay(long newStartUpDelay)

Specified by:
setStartUpDelay in interface TransportRelationshipLabel
Parameters:
newStartUpDelay - the new value of the 'Start Up Delay' attribute.
See Also:
TransportRelationshipLabel.getStartUpDelay()

send

public void send(Node here,
                 org.eclipse.emf.ecore.EObject departees)
Description copied from interface: TransportRelationshipLabel
Send a representation of population members to be "transported" from the Node here to the other Node in the relationship.

Specified by:
send in interface TransportRelationshipLabel
Parameters:
here - the Node the population members depart from
departees - the population member representation
See Also:
TransportRelationshipLabel.send(org.eclipse.ohf.stem.core.graph.Node, org.eclipse.emf.ecore.EObject)

receive

public org.eclipse.emf.common.util.EList receive(Node here,
                                                 STEMTime currentTime)
Description copied from interface: TransportRelationshipLabel
Receive some travelers.

Specified by:
receive in interface TransportRelationshipLabel
Parameters:
here - the Node of arrival
currentTime - the current time of the simulation
Returns:
all of the representations of population members who have traveled to the Node here by the currentTime
See Also:
TransportRelationshipLabel.receive(org.eclipse.ohf.stem.core.graph.Node, org.eclipse.ohf.stem.core.model.STEMTime)

getTransportEdgesToNode

public static java.util.List<Edge> getTransportEdgesToNode(Node node,
                                                           java.lang.String populationIdentifier)
Parameters:
node - the node
populationIdentifier - the population being transported
Returns:
the Edges that represent the transportation of population members to the node.

getTransportEdgesFromNode

public static java.util.List<Edge> getTransportEdgesFromNode(Node node,
                                                             java.lang.String populationIdentifier)
Parameters:
node - the node
populationIdentifier - the population being transported
Returns:
the Edges that represent the transportation of population members to the node.

reset

public void reset()
Description copied from class: DynamicLabelImpl
Set the next value valid flag to false.

Specified by:
reset in interface DynamicLabel
Overrides:
reset in class DynamicLabelImpl

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 DynamicEdgeLabelImpl

eSet

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

Specified by:
eSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eSet in class DynamicEdgeLabelImpl

eUnset

public void eUnset(int featureID)

Specified by:
eUnset in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eUnset in class DynamicEdgeLabelImpl

eIsSet

public boolean eIsSet(int featureID)

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

toString

public java.lang.String toString()

Overrides:
toString in class DynamicLabelImpl

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 DynamicLabelImpl
Returns:
true if the instance is "sane", false otherwise.
See Also:
DynamicLabelImpl.sane()