-
Notifications
You must be signed in to change notification settings - Fork 99
ThreeD_step1
In this first step, we will see how to define a 3D environment and populate it.
Initialize a 3D world with a population of cells placed randomly in a 3D 100x100x100 cube.
- Definition of the
cell
species. - Definition of the
nb_cells
parameter. - Creation of
nb_cells
cell agents randomly located in the 3D environment, that is defined as a cub of dimensions: 100x100x100.
In this model, we define one species of agent: the cell
species. The agents will be just displayed as a blue sphere of radius 1.
species cell {
aspect default {
draw sphere(1) color: #blue;
}
}
Definition of a global variable nb_cells
of type int
representing the number of cell
agents.
global {
int nb_cells <- 100;
}
Definition of the init
block in order to create nb_cells
cell
agents. By default, an agent is created with a random location in x and y, and a z value equal to 0. In our case, we want to place the cell
agents randomly in the 3D environment so we set a random value for x
, y
and z
.
create cell number: nb_cells {
location <- {rnd(100), rnd(100), rnd(100)};
}
In our model, we define a basic gui experiment called Tuto3D :
experiment Tuto3D type: gui {
}
Definition of a parameter from the global variable nb_cells
:
experiment Tuto3D type: gui {
parameter "Initial number of cells: " var: nb_cells min: 1 max: 1000 category: "Cells";
}
In our model, we define a display to draw the cell
agents in a 3D environment.
output {
display View1 type:opengl {
species cell;
}
}
https://github.com/gama-platform/gama/blob/GAMA_1.9.2/msi.gama.models/models/Tutorials/3D/models/Model%2001.gaml
- Installation and Launching
- Workspace, Projects and Models
- Editing Models
- Running Experiments
- Running Headless
- Preferences
- Troubleshooting
- Introduction
- Manipulate basic Species
- Global Species
- Defining Advanced Species
- Defining GUI Experiment
- Exploring Models
- Optimizing Model Section
- Multi-Paradigm Modeling
- Manipulate OSM Data
- Diffusion
- Using Database
- Using FIPA ACL
- Using BDI with BEN
- Using Driving Skill
- Manipulate dates
- Manipulate lights
- Using comodel
- Save and restore Simulations
- Using network
- Headless mode
- Using Headless
- Writing Unit Tests
- Ensure model's reproducibility
- Going further with extensions
- Built-in Species
- Built-in Skills
- Built-in Architecture
- Statements
- Data Type
- File Type
- Expressions
- Exhaustive list of GAMA Keywords
- Installing the GIT version
- Developing Extensions
- Introduction to GAMA Java API
- Using GAMA flags
- Creating a release of GAMA
- Documentation generation