-
Notifications
You must be signed in to change notification settings - Fork 99
DXF_to_Agents_Model
Julius Bañgate edited this page Apr 17, 2023
·
3 revisions
Path: Library models/Data/Data Importation/models/DXF File Import.gaml
/**
* Name: DXF to Agents Model
* Author: Patrick Taillandier
* Description: Model which shows how to create agents by importing data of a DXF file
* Tags: dxf, load_file
*/
model DXFAgents
global
{
file house_file <- dxf_file("../includes/house.dxf",#m);
//compute the environment size from the dxf file envelope
geometry shape <- envelope(house_file);
init
{
//create house_element agents from the dxf file and initialized the layer attribute of the agents from the the file
create house_element from: house_file with: [layer::string(get("layer"))];
//define a random color for each layer
map layers <- list(house_element) group_by each.layer;
loop la over: layers.keys
{
rgb col <- rnd_color(255);
ask layers[la]
{
color <- col;
}
}
}
}
species house_element
{
string layer;
rgb color;
aspect default
{
draw shape color: color;
}
init {
shape <- polygon(shape.points);
}
}
experiment DXFAgents type: gui
{
output
{ layout #split;
display map type: 3d
{
species house_element;
}
display "As_Image" type: 3d
{
graphics "House"
{
draw house_file at: {0,0} color: # brown;
}
}
}
}
- 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