de.cesr.sesamgim.context
Class GUpdatablePlzContext<AgentType extends GimMilieuAgent<AgentType>>

java.lang.Object
  extended by java.util.AbstractCollection<T>
      extended by repast.simphony.context.AbstractContext<T>
          extended by repast.simphony.context.SmallDefaultContext<T>
              extended by repast.simphony.context.DefaultContext<AgentType>
                  extended by de.cesr.sesamgim.context.GPlzContext<AgentType>
                      extended by de.cesr.sesamgim.context.GUpdatablePlzContext<AgentType>
All Implemented Interfaces:
GimAgentNumberProvidingContext<AgentType>, GimMilieuContextAwareContext<AgentType>, GimPlzContext<AgentType>, GimSuperContextAssignable<AgentType>, GimUpdatableContext<AgentType>, GimUpdatablePlzContext<AgentType>, Iterable<AgentType>, Collection<AgentType>, repast.simphony.context.Context<AgentType>, repast.simphony.context.ContextListener, repast.simphony.context.RepastElement

public class GUpdatablePlzContext<AgentType extends GimMilieuAgent<AgentType>>
extends GPlzContext<AgentType>
implements GimUpdatablePlzContext<AgentType>

SesamGIM - Geographical Initialisation for Milieu Agents


Field Summary
protected  Map<Integer,GimMilieuContext<AgentType>> milieuContextMap
           
 
Fields inherited from class de.cesr.sesamgim.context.GPlzContext
id
 
Fields inherited from class repast.simphony.context.SmallDefaultContext
allObjs, objectMap
 
Fields inherited from class repast.simphony.context.AbstractContext
subContexts
 
Fields inherited from interface repast.simphony.context.Context
SYN_CONTEXT_PREFIX
 
Constructor Summary
GUpdatablePlzContext()
           
 
Method Summary
 boolean addAgent(AgentType agent)
          Substitutes Collection.add(Object) in order to add agents to GimMilieuContexts.
 String getID()
          Return the context's id.
 GimMilieuContext<AgentType> getMilieu(int milieuId)
          Returns the milieu context of this market cell with the given ID
protected  Map<Integer,GimMilieuContext<AgentType>> getMilieuContextMap()
           
 int getNumHouseholds(Calendar cal, int milieuGroup, int hhSize)
          Returns the number of households within this market cell (usually as defined in Microm (R) data).
 void setUpdatableContextStructure(GUpdatableContextStructure structure)
           
 
Methods inherited from class de.cesr.sesamgim.context.GPlzContext
assignSuperContext, getDirectObjects, getPlzId, setPLZ99, toString
 
Methods inherited from class repast.simphony.context.DefaultContext
addInternal, containsInternal, iteratorInternal, removeInternal, sizeInternal
 
Methods inherited from class repast.simphony.context.SmallDefaultContext
getObjects, getRandomObject, getRandomObjects
 
Methods inherited from class repast.simphony.context.AbstractContext
add, addContextListener, addProjection, addSubContext, addValueLayer, clear, contains, eventOccured, findContext, findParent, fireAddContextEvent, fireRemoveEvent, fireSubContextAdded, fireSubContextRemoved, getAgentLayer, getAgentTypes, getContextListeners, getId, getProjection, getProjection, getProjections, getProjections, getSubContext, getSubContexts, getTypeID, getValueLayer, getValueLayers, handleRemove, hasSubContext, iterator, query, remove, removeContextListener, removeProjection, removeSubContext, removeValueLayer, setId, setTypeID, size
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.cesr.sesamgim.context.GimPlzContext
getDirectObjects, getPlzId
 
Methods inherited from interface de.cesr.sesamgim.context.GimSuperContextAssignable
assignSuperContext
 
Methods inherited from interface repast.simphony.context.Context
addContextListener, addProjection, addSubContext, addValueLayer, findContext, findParent, getAgentLayer, getAgentTypes, getContextListeners, getObjects, getProjection, getProjection, getProjections, getProjections, getRandomObject, getRandomObjects, getSubContext, getSubContexts, getTypeID, getValueLayer, getValueLayers, hasSubContext, query, removeContextListener, removeProjection, removeSubContext, removeValueLayer, setTypeID
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface repast.simphony.context.RepastElement
getId, setId
 

Field Detail

milieuContextMap

protected Map<Integer,GimMilieuContext<AgentType extends GimMilieuAgent<AgentType>>> milieuContextMap
Constructor Detail

GUpdatablePlzContext

public GUpdatablePlzContext()
Method Detail

getNumHouseholds

public int getNumHouseholds(Calendar cal,
                            int milieuGroup,
                            int hhSize)
Description copied from interface: GimAgentNumberProvidingContext
Returns the number of households within this market cell (usually as defined in Microm (R) data).

Specified by:
getNumHouseholds in interface GimAgentNumberProvidingContext<AgentType extends GimMilieuAgent<AgentType>>
Returns:

getMilieu

public GimMilieuContext<AgentType> getMilieu(int milieuId)
Description copied from interface: GimMilieuContextAwareContext
Returns the milieu context of this market cell with the given ID

Specified by:
getMilieu in interface GimMilieuContextAwareContext<AgentType extends GimMilieuAgent<AgentType>>
Parameters:
milieuId - milieu ID of the Milieu
Returns:
milieu context
See Also:
GimMilieuContextAwareContext.getMilieu(int)

addAgent

public boolean addAgent(AgentType agent)
Description copied from interface: GimMilieuContextAwareContext
Substitutes Collection.add(Object) in order to add agents to GimMilieuContexts.

Specified by:
addAgent in interface GimMilieuContextAwareContext<AgentType extends GimMilieuAgent<AgentType>>
Returns:
See Also:
GimMilieuContextAwareContext.addAgent(de.cesr.sesamgim.init.agent.GimMilieuAgent)

getMilieuContextMap

protected Map<Integer,GimMilieuContext<AgentType>> getMilieuContextMap()
Returns:

getID

public String getID()
Description copied from interface: GimMilieuContextAwareContext
Return the context's id. This is the MC id for GimMarketCellContexts or the PLZ for GimPlzContexts.

Specified by:
getID in interface GimMilieuContextAwareContext<AgentType extends GimMilieuAgent<AgentType>>
Returns:
id

setUpdatableContextStructure

public void setUpdatableContextStructure(GUpdatableContextStructure structure)
Specified by:
setUpdatableContextStructure in interface GimAgentNumberProvidingContext<AgentType extends GimMilieuAgent<AgentType>>
Parameters:
structure -