Geographical Environment
Overview
In MAGE, a geographical environment refers to a spatial structure that represents the world or space as a continuous and varied landscape, rather than being divided into discrete cells. This environment provides a naturalistic framework in which agents can move, interact, and make decisions. Here are some key points about geographical environments in MAGE:
-
Continuous Space: Unlike the grid-based approach, the geographical environment does not constrain agents to discrete cells. For example, in a simulation of wildlife migration, agents representing animals can move freely across a continuous landscape, encountering various terrains such as forests, rivers, and mountains that affect their behavior and movement.
-
Agent Interaction: Agents in the simulation navigate the landscape, interacting with each other and the environment based on their location. These interactions can be influenced by geographical features and distances, with rules that might consider the terrain’s impact on visibility, movement speed, and resource availability.
-
Boundaries: The geographical environment can have natural boundaries, such as oceans, mountain ranges, or rivers, which limit the movement of agents or define their habitats.
-
Scale and Granularity: The resolution of the geographical data and the scale of the simulation determine its detail and computational requirements. High-resolution data allows for more detailed simulations but requires greater computational resources.
-
Variability: Geographical environments inherently include a variety of terrains and ecosystems, offering a rich context for agent interactions. Agents might experience different conditions based on their location, such as varying weather, terrain ruggedness, and resource availability.
-
Dynamics: The state of the environment and its components can change over time, influenced by natural processes or the actions of agents within the simulation. For example, vegetation might grow or be consumed by herbivores, and rivers might change course.
-
Heterogeneity: Agents operating within a geographical environment can be highly diverse, with different species or entities having unique attributes, behaviors, and decision-making processes that are influenced by the environment.
In summary, a geographical environment in MAGE offers a realistic and dynamic spatial framework that supports complex agent interactions and decision-making. This type of environment is especially valuable in simulations that aim to mimic real-world ecological systems, geological processes, or human-environment interactions, where the continuous and varied nature of the landscape plays a critical role.
Defining of a Geographical Environment
In MAGE, a geographical environment is defined using the GeoEnvironment
agent.
1. Create the Geographical Environment
Within the setup method of the Mage of the simulation model, an instance of GeoEnvironment
is created, which is named “MyGeoEnvironment”:
var environment = create(new GeoEnvironment("MyGridEnvironment"));
Adding Agents to a Geographical Environment
To create agents for the grid environment, nothing special needs to be done.
1. Create Agents
Agents can be created one by one:
Agent agent = create(new Agent() {
//... agent setup code ...
});
//... environment add code ...
or in a loop, usually that iterates over the total number of cells in the grid (rows multiplied by columns):
for (int i = 0; i < numOfRows * numOfColumns; i++) {
Agent agent = create(new Agent() {
//... agent setup code ...
});
//... environment add code ...
}
2. Add Agents to the Grid
After an agent is created, it can be added to the grid environment using the add
method of GeoEnvironment
which adds the agent to the next grid cell:
environment.add(agent, latitude, longitude);
Upon being added to the geographical environment, GeoEnvironment
assigns the GeoElement
role to the agents.
Agent Behaviors in a Grid Environment
The GridElement
role in the SCOP Framework provides a set of behaviors that an agent can perform in a grid environment. These behaviors enable the agent to interact with the environment, move within it, and gather information about neighboring agents.
1. Getting the Current Position
The agent can get its current cell in a geographical environment using:
final public double getLatitude();
final public double getLongitude();
2. Setting the Current Position
The agent can set its current position in a geographical environment using:
final public void setPosition(double latitude, double longitude);
3. Moving the Agent
The agent can move to specific row and column in a geographical environment using:
final public Action moveTo(double latitude, double longitude);
The agent can move towards a specific direction (e.g., NORTH, SOUTH, EAST, WEST) in the grid using:
final public Action moveTo(Direction direction);
4. Wandering the Agent
The agent can move around in a geographical environment without a specific course, aim or goal by either sweeping the grid:
final public Action sweep();
or doing a random walk using its four neighbors:
final public Action randomWalk4();
or doing a random walk using its eight neighbours:
final public Action randomWalk8();
5. Upcoming Methods
The following methods are marked as deprecated, meaning they have not been implemented yet:
-
Move Towards a Target Position:
@Deprecated public Action moveTowardTarget(double targetLatitude, double targetLongitude);
By using these behaviors, agents can actively navigate and interact within a geographical environment in the SCOP Framework.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.