|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.cesr.sesamgim.init.agent.GAreaAgentInitialiser<AgentType>
public class GAreaAgentInitialiser<AgentType extends GimMilieuAgent<AgentType>>
Initializes the agents of an entire area at once. - Queries all market cells as sub-contexts of the given area context - For each market cell: - Fetches data about agents in the market cell - Calculates the number of required group contexts - Initialises agents and assign them to group contexts.
Field Summary | |
---|---|
protected NumberFormat |
format
|
protected GimMilieuKeyMap |
milieuMap
|
protected de.cesr.uranus.core.UranusRandomService |
randomService
|
Constructor Summary | |
---|---|
GAreaAgentInitialiser()
Assigns the main context. |
Method Summary | |
---|---|
protected void |
adaptMilieuSums()
Adapt numbers in milieuSums in a way that, each value divided by GBasicPa.NUM_HH_PER_AGENT), the sum is a multiplicative of GMilieuPa.GROUP_SIZE |
protected void |
calculateAgentSums(GimMarketCellContext<AgentType> mc)
|
protected com.vividsolutions.jts.geom.Point |
findPlaceExtending(GimAreaContext<? super AgentType> area,
repast.simphony.space.gis.Geography<Object> areas,
GimUpdatableContext<AgentType> uc,
com.vividsolutions.jts.geom.Coordinate centerCoords,
com.vividsolutions.jts.geom.Envelope env,
double initStdDev,
String generator)
Searches for a point (mostly for the location of group context) within the given area near the given MC coordinates. |
GimGroupInitialiseService<AgentType> |
getGroupIS()
|
Collection<AgentType> |
initAgents(GimModelInitialiser<AgentType> gimInitialiser)
|
protected boolean |
initAgentsPerUpdatableContext(Collection<AgentType> agents,
GimAreaContext<AgentType> area,
GimUpdatableContext<AgentType> uc)
|
protected GimGroupInitialiser<AgentType> |
initialiseGroups(GimAreaContext<AgentType> area,
GimMarketCellContext<AgentType> mc,
GimGroupInitialiser<AgentType> gi)
|
protected void |
logGroupContexts(GimUpdatableContext<AgentType> uc)
|
protected void |
logGroupContextsAsTotal(GimAreaContext<AgentType> area,
int numAgents)
|
void |
placeAgent(GimAreaContext<AgentType> area,
GimUpdatableContext<AgentType> uc,
AgentType agent)
|
void |
placeAgentNearMarketCell(AgentType agent,
GimAreaContext<? super AgentType> area,
GimMarketCellContext<AgentType> mc)
|
void |
placeGroupContext(GimGroupContext<AgentType> gc,
GimAreaContext<? super AgentType> area,
GimMarketCellContext<AgentType> mc)
Determines a geographical centre for the given NeighbourhoodContext near the given
MarketCellContext using GAreaAgentInitialiser#STD_DEV_PLACE_NEIGHBOURHOODS . |
void |
placeGroupContextOnRadius(Collection<GimGroupContext<AgentType>> gcCol,
GimAreaContext<? super AgentType> area,
GimMarketCellContext<AgentType> mc)
Determines a geographical center for the given GGroupContext on a radius around the given
MarketCellContext using GBasicPa.PLACE_GROUP_ON_RADIUS . |
protected void |
processAgentNumberUnits(Collection<AgentType> agents,
GimAreaContext<AgentType> area)
|
void |
setGroupIS(GimGroupInitialiseService<AgentType> groupIS)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final de.cesr.uranus.core.UranusRandomService randomService
protected final NumberFormat format
protected GimMilieuKeyMap milieuMap
Constructor Detail |
---|
public GAreaAgentInitialiser()
mainContext
- the root contextMethod Detail |
---|
public Collection<AgentType> initAgents(GimModelInitialiser<AgentType> gimInitialiser)
initAgents
in interface GimAgentInitialiser<AgentType extends GimMilieuAgent<AgentType>>
init.AgentInitializer#initAgents(contexts.AreaContext)
protected void processAgentNumberUnits(Collection<AgentType> agents, GimAreaContext<AgentType> area)
agents
- area
- protected boolean initAgentsPerUpdatableContext(Collection<AgentType> agents, GimAreaContext<AgentType> area, GimUpdatableContext<AgentType> uc)
agents
- area
- uc
-
protected void logGroupContextsAsTotal(GimAreaContext<AgentType> area, int numAgents)
area
- numAgents
- protected void logGroupContexts(GimUpdatableContext<AgentType> uc)
uc
- protected GimGroupInitialiser<AgentType> initialiseGroups(GimAreaContext<AgentType> area, GimMarketCellContext<AgentType> mc, GimGroupInitialiser<AgentType> gi)
area
- mc
- gi
-
protected void calculateAgentSums(GimMarketCellContext<AgentType> mc)
mc
- protected void adaptMilieuSums()
public void placeAgent(GimAreaContext<AgentType> area, GimUpdatableContext<AgentType> uc, AgentType agent)
placeAgent
in interface GimAgentPlacingInitialiser<AgentType extends GimMilieuAgent<AgentType>>
area
- mc
- agent
- public void placeAgentNearMarketCell(AgentType agent, GimAreaContext<? super AgentType> area, GimMarketCellContext<AgentType> mc)
agent
- area
- mc
- public void placeGroupContext(GimGroupContext<AgentType> gc, GimAreaContext<? super AgentType> area, GimMarketCellContext<AgentType> mc)
NeighbourhoodContext
near the given
MarketCellContext
using GAreaAgentInitialiser#STD_DEV_PLACE_NEIGHBOURHOODS
. Ensures that the
neighourhood's centre is located within the area.
Furthermore, it checks for containment in inhabited area, if
BasicPa#ALLOW_AGENTS_TO_LEAVE_INHABITED_AREAS
is not true.
gc
- the neighbourhood context to placearea
- the area the NC shall be placed within.mc
- the market cell this NC belongs toprotected com.vividsolutions.jts.geom.Point findPlaceExtending(GimAreaContext<? super AgentType> area, repast.simphony.space.gis.Geography<Object> areas, GimUpdatableContext<AgentType> uc, com.vividsolutions.jts.geom.Coordinate centerCoords, com.vividsolutions.jts.geom.Envelope env, double initStdDev, String generator)
GMilieuPa.ALLOW_AGENTS_TO_LEAVE_AREA_BOUNDARIES
and
GMilieuPa.ALLOW_AGENTS_TO_LEAVE_INHABITED_AREAS
and searches again with increased standard deviation
after STD_DEV_EXTENSION_COUNTER_TRESHOLD
unsuccessful searches.
area
- areas
- centerCoords
- env
- stdDev
-
public void placeGroupContextOnRadius(Collection<GimGroupContext<AgentType>> gcCol, GimAreaContext<? super AgentType> area, GimMarketCellContext<AgentType> mc)
GGroupContext
on a radius around the given
MarketCellContext
using GBasicPa.PLACE_GROUP_ON_RADIUS
. Ensures that the neighourhood's center is
located within the area.
gcCol
- the collection of group contexts to placearea
- the area the GC shall be placed within.mc
- the market cell this GC belongs topublic GimGroupInitialiseService<AgentType> getGroupIS()
public void setGroupIS(GimGroupInitialiseService<AgentType> groupIS)
groupInitialiser
- the groupInitialiser to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |