Skip to content

Commit

Permalink
new plugin pedestrian
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaillandier committed May 12, 2021
1 parent 1d5e72c commit fb050ad
Show file tree
Hide file tree
Showing 40 changed files with 2,514 additions and 0 deletions.
16 changes: 16 additions & 0 deletions miat.gaml.extensions.pedestrian/.classpath
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gaml">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
3 changes: 3 additions & 0 deletions miat.gaml.extensions.pedestrian/.factorypath
@@ -0,0 +1,3 @@
<factorypath>
<factorypathentry kind="WKSPJAR" id="/msi.gama.processor/processor/plugins/msi.gama.processor_1.4.0.jar" enabled="true" runInBatchMode="false"/>
</factorypath>
28 changes: 28 additions & 0 deletions miat.gaml.extensions.pedestrian/.project
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>miat.gaml.extensions.pedestrian</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=gaml
org.eclipse.jdt.apt.reconcileEnabled=true
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.processAnnotations=enabled
org.eclipse.jdt.core.compiler.source=1.8
12 changes: 12 additions & 0 deletions miat.gaml.extensions.pedestrian/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Pedestrian
Bundle-SymbolicName: miat.gaml..extension.pedestrian;singleton:=true
Bundle-Version: 1.0.0.qualifier
Automatic-Module-Name: escape.gaml.additions
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: msi.gama.core;bundle-version="1.7.0",
msi.gama.ext;bundle-version="1.7.0"
Export-Package: miat.gaml.extensions.operator,
miat.gaml.extensions.skills
Bundle-ClassPath: .
6 changes: 6 additions & 0 deletions miat.gaml.extensions.pedestrian/build.properties
@@ -0,0 +1,6 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
models/
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ESCAPE extensions example</name>
<comment>pedestrian plugin</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>msi.gama.application.gamaNature</nature>
<nature>msi.gama.application.pluginNature</nature>
</natures>
</projectDescription>
19 changes: 19 additions & 0 deletions miat.gaml.extensions.pedestrian/models/Pedestrian skill/.project
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ESCAPE extensions example</name>
<comment>pedestrian plugin</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>msi.gama.application.gamaNature</nature>
<nature>msi.gama.application.pluginNature</nature>
</natures>
</projectDescription>
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,18 @@
PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",
GEOGCS["GCS_WGS_1984",
DATUM["D_WGS_1984",
SPHEROID["WGS_1984", 6378137.0, 298.257223563]],
PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295],
AXIS["Longitude", EAST],
AXIS["Latitude", NORTH]],
PROJECTION["Popular Visualisation Pseudo Mercator"],
PARAMETER["semi_minor", 6378137.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["central_meridian", 0.0],
PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["x", EAST],
AXIS["y", NORTH]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,18 @@
PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",
GEOGCS["GCS_WGS_1984",
DATUM["D_WGS_1984",
SPHEROID["WGS_1984", 6378137.0, 298.257223563]],
PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295],
AXIS["Longitude", EAST],
AXIS["Latitude", NORTH]],
PROJECTION["Popular Visualisation Pseudo Mercator"],
PARAMETER["semi_minor", 6378137.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["central_meridian", 0.0],
PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["x", EAST],
AXIS["y", NORTH]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,18 @@
PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",
GEOGCS["GCS_WGS_1984",
DATUM["D_WGS_1984",
SPHEROID["WGS_1984", 6378137.0, 298.257223563]],
PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295],
AXIS["Longitude", EAST],
AXIS["Latitude", NORTH]],
PROJECTION["Popular Visualisation Pseudo Mercator"],
PARAMETER["semi_minor", 6378137.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["central_meridian", 0.0],
PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["x", EAST],
AXIS["y", NORTH]]
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
OEM 1252
Binary file not shown.
@@ -0,0 +1 @@
PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]
@@ -0,0 +1 @@
PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,170 @@
/***
* Name: pedestrian_complex_environment
* Author: Patrick Taillandier
* Description: show how to use the pedestrian skill for complex envorinment - require to generate pedestrian paths before - see model "Generate Pedestrian path.gaml"
* Tags: pedestrian, gis, shapefile, graph, agent_movement, skill, transport
***/

model pedestrian_complex_environment

global {

file wall_shapefile <- file("../includes/walls.shp");

shape_file free_spaces_shape_file <- shape_file("../includes/free spaces.shp");
shape_file open_area_shape_file <- shape_file("../includes/open area.shp");
shape_file pedestrian_paths_shape_file <- shape_file("../includes/pedestrian paths.shp");


graph network;

geometry shape <- envelope(wall_shapefile);

bool display_free_space <- false parameter: true;
bool display_force <- false parameter: true;
bool display_target <- false parameter: true;
bool display_circle_min_dist <- true parameter: true;

float P_shoulder_length <- 0.45 parameter: true;
float P_proba_detour <- 0.5 parameter: true ;
bool P_avoid_other <- true parameter: true ;
float P_obstacle_consideration_distance <- 3.0 parameter: true ;
float P_pedestrian_consideration_distance <- 3.0 parameter: true ;
float P_minimal_distance <- 0.0 parameter: true;
float P_tolerance_target <- 0.1 parameter: true;
bool P_use_geometry_target <- true parameter: true;

float P_A_pedestrian_SFM parameter: true <- 0.16 category: "SFM" ;
float P_A_obstacles_SFM parameter: true <- 1.9 category: "SFM" ;
float P_B_pedestrian_SFM parameter: true <- 0.1 category: "SFM" ;
float P_B_obstacles_SFM parameter: true <- 1.0 category: "SFM" ;
float P_relaxion_SFM parameter: true <- 0.5 category: "SFM" ;
float P_gama_SFM parameter: true <- 0.35 category: "SFM" ;
float P_lambda_SFM <- 0.1 parameter: true category: "SFM" ;


float step <- 0.1;
int nb_people <- 100;

geometry open_area ;

init {
open_area <- first(open_area_shape_file.contents);
create wall from:wall_shapefile;
create pedestrian_path from: pedestrian_paths_shape_file {
list<geometry> fs <- free_spaces_shape_file overlapping self;
free_space <- fs first_with (each covers shape);
}


network <- as_edge_graph(pedestrian_path);

ask pedestrian_path {
do build_intersection_areas pedestrian_graph: network;
}

create people number:nb_people{
location <- any_location_in(one_of(open_area));
obstacle_consideration_distance <-P_obstacle_consideration_distance;
pedestrian_consideration_distance <-P_pedestrian_consideration_distance;
shoulder_length <- P_shoulder_length;
avoid_other <- P_avoid_other;
proba_detour <- P_proba_detour;
minimal_distance <- P_minimal_distance;
A_pedestrians_SFM <- P_A_pedestrian_SFM;
A_obstacles_SFM <- P_A_obstacles_SFM;
B_pedestrians_SFM <- P_B_pedestrian_SFM;
B_obstacles_SFM <- P_B_obstacles_SFM;
relaxion_SFM <- P_relaxion_SFM;
gama_SFM <- P_gama_SFM;
lambda_SFM <- P_lambda_SFM;
use_geometry_target <- P_use_geometry_target;
tolerance_target <- P_tolerance_target;

pedestrian_species <- [people];
obstacle_species<-[wall];

}
}

reflex stop when: empty(people) {
do pause;
}

}

species pedestrian_path skills: [pedestrian_road]{
aspect default {
draw shape color: #gray;
}
aspect free_area_aspect {
if(display_free_space and free_space != nil) {
draw free_space color: #lightpink border: #black;
}

}
}

species wall {
geometry free_space;
float high <- rnd(10.0, 20.0);

aspect demo {
draw shape border: #black depth: high texture: ["../includes/top.png","../includes/texture5.jpg"];
}

aspect default {
draw shape + (P_shoulder_length/2.0) color: #gray border: #black;
}
}

species people skills: [pedestrian]{
rgb color <- rnd_color(255);
float speed <- gauss(5,1.5) #km/#h min: 2 #km/#h;

reflex move {
if (final_target = nil) {
do compute_virtual_path pedestrian_graph:network final_target: any_location_in(open_area) ;
}
do walk ;
}

aspect default {

if display_circle_min_dist and minimal_distance > 0 {
draw circle(minimal_distance).contour color: color;
}

draw triangle(shoulder_length) color: color rotate: heading + 90.0;

if display_target and current_target != nil {
draw line([location,current_target]) color: color;
}
if display_force {
loop op over: forces.keys {
if (species(agent(op)) = wall ) {
draw line([location, location + point(forces[op])]) color: #red end_arrow: 0.1;
}
else if ((agent(op)) = self ) {
draw line([location, location + point(forces[op])]) color: #blue end_arrow: 0.1;
}
else {
draw line([location, location + point(forces[op])]) color: #green end_arrow: 0.1;
}
}
}
}
}


experiment normal_sim type: gui {
float minimum_cycle_duration <- 0.05;
output {
display map type: opengl{
species wall refresh: false;
species pedestrian_path aspect:free_area_aspect transparency: 0.5 ;
species pedestrian_path refresh: false;
species people;
}
}
}

0 comments on commit fb050ad

Please sign in to comment.