-
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 cells species
- Definition of the nb_cells parameter
- Creation of nb_cells cells agents randomly located in the 3D environment size: 100x100x100.
In this model we define one species of agent: the cells agents. The agents will be just displayed as a blue sphere of radius 1.
species cells{
aspect default {
draw sphere(1) color:#blue;
}
}
Definition of a global variable nb_cells of type int representing the number of cells agents.
global {
int nb_cells <-100;
}
Definition of the init block in order to create nb_cells cells 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 cells randomly in the 3D environment so we set a random value for x, y and z.
create cells 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 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 cells agents in a 3D environment.
output {
display View1 type:opengl {
species cells;
}
}
This model is available in the model library (under Tutorials > 3D) and the GIT version of the model can be found here Model 01.gaml
model Tuto3D
global {
int nb_cells <-100;
init {
create cells number: nb_cells {
location <- {rnd(100), rnd(100), rnd(100)};
}
}
}
species cells{
aspect default {
draw sphere(1) color:#blue;
}
}
experiment Tuto3D type: gui {
parameter "Initial number of cells: " var: nb_cells min: 1 max: 1000 category: "Cells" ;
output {
display View1 type:opengl {
species cells;
}
}
}
- 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