Permalink
Browse files

* SIMS: Split Zone Coverage sims into zone_coverage_line, zone_covera…

…ge_arc, and zone_coverage_onion directories

* LICENSE: Modified license to include recent years
* SIMS: Updated sims to set default buffer size to 2MB for simulated agents
* Streamlined a function in ZoneCoverage to not use goto statements for readability
* Updated to version 0.9.23
  • Loading branch information...
jredmondson committed Feb 2, 2016
1 parent 1ae1e9f commit bb283f08edcd14d3806e1c02e743a6e92b8ebcce
Showing with 524 additions and 190 deletions.
  1. +1 −1 LICENSE.txt
  2. +1 −1 VERSION.txt
  3. +2 −2 scripts/simulation/simulation.pm
  4. 0 scripts/simulation/{zone_coverage → zone_coverage_arc}/madara_init_0.mf
  5. 0 scripts/simulation/{zone_coverage → zone_coverage_arc}/madara_init_1.mf
  6. 0 scripts/simulation/{zone_coverage → zone_coverage_arc}/madara_init_2.mf
  7. 0 scripts/simulation/{zone_coverage → zone_coverage_arc}/madara_init_3.mf
  8. 0 scripts/simulation/{zone_coverage → zone_coverage_arc}/madara_init_4.mf
  9. 0 scripts/simulation/{zone_coverage → zone_coverage_arc}/madara_init_5.mf
  10. 0 scripts/simulation/{zone_coverage → zone_coverage_arc}/madara_init_6.mf
  11. 0 scripts/simulation/{zone_coverage → zone_coverage_arc}/madara_init_7.mf
  12. 0 scripts/simulation/{zone_coverage → zone_coverage_arc}/madara_init_8.mf
  13. +18 −0 scripts/simulation/zone_coverage_arc/madara_init_common.mf
  14. +2 −2 scripts/simulation/{zone_coverage → zone_coverage_arc}/zone_coverage_simulation.pl
  15. +10 −0 scripts/simulation/zone_coverage_line/madara_init_0.mf
  16. +15 −0 scripts/simulation/zone_coverage_line/madara_init_1.mf
  17. +12 −0 scripts/simulation/zone_coverage_line/madara_init_2.mf
  18. +15 −0 scripts/simulation/zone_coverage_line/madara_init_3.mf
  19. +15 −0 scripts/simulation/zone_coverage_line/madara_init_4.mf
  20. +15 −0 scripts/simulation/zone_coverage_line/madara_init_5.mf
  21. +15 −0 scripts/simulation/zone_coverage_line/madara_init_6.mf
  22. +16 −0 scripts/simulation/zone_coverage_line/madara_init_7.mf
  23. +15 −0 scripts/simulation/zone_coverage_line/madara_init_8.mf
  24. +19 −0 scripts/simulation/zone_coverage_line/madara_init_common.mf
  25. +17 −0 scripts/simulation/zone_coverage_line/zone_coverage_simulation.pl
  26. +9 −0 scripts/simulation/zone_coverage_onion/madara_init_0.mf
  27. +14 −0 scripts/simulation/zone_coverage_onion/madara_init_1.mf
  28. 0 scripts/simulation/{zone_coverage → zone_coverage_onion}/madara_init_10.mf
  29. 0 scripts/simulation/{zone_coverage → zone_coverage_onion}/madara_init_11.mf
  30. 0 scripts/simulation/{zone_coverage → zone_coverage_onion}/madara_init_12.mf
  31. 0 scripts/simulation/{zone_coverage → zone_coverage_onion}/madara_init_13.mf
  32. 0 scripts/simulation/{zone_coverage → zone_coverage_onion}/madara_init_14.mf
  33. 0 scripts/simulation/{zone_coverage → zone_coverage_onion}/madara_init_15.mf
  34. +11 −0 scripts/simulation/zone_coverage_onion/madara_init_2.mf
  35. +14 −0 scripts/simulation/zone_coverage_onion/madara_init_3.mf
  36. +14 −0 scripts/simulation/zone_coverage_onion/madara_init_4.mf
  37. +14 −0 scripts/simulation/zone_coverage_onion/madara_init_5.mf
  38. +14 −0 scripts/simulation/zone_coverage_onion/madara_init_6.mf
  39. +15 −0 scripts/simulation/zone_coverage_onion/madara_init_7.mf
  40. +14 −0 scripts/simulation/zone_coverage_onion/madara_init_8.mf
  41. 0 scripts/simulation/{zone_coverage → zone_coverage_onion}/madara_init_9.mf
  42. +1 −1 scripts/simulation/{zone_coverage → zone_coverage_onion}/madara_init_common.mf
  43. +17 −0 scripts/simulation/zone_coverage_onion/zone_coverage_simulation.pl
  44. +169 −160 src/gams/algorithms/ZoneCoverage.cpp
  45. +10 −10 src/gams/algorithms/ZoneCoverage.h
  46. +20 −13 src/simulation/dynamic_simulation.cpp
@@ -1,4 +1,4 @@
Copyright (c) 2013-2014 Carnegie Mellon University. All Rights Reserved.
Copyright (c) 2013-2016 Carnegie Mellon University. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -1 +1 @@
0.9.22
0.9.23
@@ -22,7 +22,7 @@ sub run {
#$cmd = "$cmd gdb ";
#$cmd = "$cmd -ex \\\"set breakpoint pending on\\\" ";
#$cmd = "$cmd -ex run --args ";
$cmd = "$cmd $gams_root/gams_controller -i $i -n $num --loop-time $time --period $period";
$cmd = "$cmd $gams_root/gams_controller -i $i -n $num --loop-time $time --period $period --queue-length 2000000";
$cmd = "$cmd --madara-file $gams_root/scripts/simulation/madara_init_common.mf";
$cmd = "$cmd $gams_root/scripts/simulation/areas/$area.mf";
$cmd = "$cmd $gams_root/scripts/simulation/$sim/madara_init_common.mf";
@@ -36,7 +36,7 @@ sub run {
}
elsif ($osname eq "MSWin32") # windows default
{
$cmd = "$gams_root\\bin\\gams_controller -i $i -n $num --loop-time $time --period $period --madara-file $gams_root\\scripts\\simulation\\$sim\\madara_init_$i.mf $gams_root\\scripts\\simulation\\areas\\$area.mf $gams_root\\scripts\\simulation\\madara_init_common.mf --madara-level $madara_debug --gams-level $gams_debug";
$cmd = "$gams_root\\bin\\gams_controller -i $i -n $num --loop-time $time --period $period --madara-file $gams_root\\scripts\\simulation\\$sim\\madara_init_$i.mf $gams_root\\scripts\\simulation\\areas\\$area.mf $gams_root\\scripts\\simulation\\madara_init_common.mf --madara-level $madara_debug --gams-level $gams_debug --queue-length 2000000";
print("start \"Device$i\" /REALTIME $cmd\n\n");
system("start \"Device$i\" /REALTIME $cmd");
}
@@ -0,0 +1,18 @@
group.assets.members.size=1;
group.assets.members.0="agent.0";
group.protectors.members.size=7;
group.protectors.members.0="agent.1";
group.protectors.members.1="agent.3";
group.protectors.members.2="agent.4";
group.protectors.members.3="agent.5";
group.protectors.members.4="agent.6";
group.protectors.members.5="agent.7";
group.protectors.members.6="agent.8";
group.enemies.members.size=1;
group.enemies.members.0="agent.2";
.platform="vrep-uav";
.zone_coverage_formation="arc";
.zone_coverage_buffer=2;
.zone_coverage_distance=0.5;
@@ -7,8 +7,8 @@
$madara_debug = 5;
$gams_debug = 5;
$period = 1;
$num = 16;
$sim = "zone_coverage";
$num = 9;
$sim = "zone_coverage_arc";
$area = "small";
$border = "region.0";
$num_coverages = 0;
@@ -0,0 +1,10 @@
.vrep_port=19906;
.initial_lat=40.443222;
.initial_lon=-79.940334;
.initial_alt=4;
agent.0.command="null";
agent.0.command.size=0;
agent.0.hertz=.hertz;
@@ -0,0 +1,15 @@
.vrep_port=19907;
.initial_lat=40.443131;
.initial_lon=-79.940570;
.initial_alt=4;
agent.1.command="zone coverage";
agent.1.command.size=0;
agent.1.command.formation=.zone_coverage_formation;
agent.1.command.assets="assets";
agent.1.command.protectors="protectors";
agent.1.command.enemies="enemies";
agent.1.command.buffer=.zone_coverage_buffer;
agent.1.command.distance=.zone_coverage_distance;
agent.1.hertz=.hertz;
@@ -0,0 +1,12 @@
.vrep_port=19908;
.vrep_max_delta=0.5;
.vrep_thread_move_speed=1;
.initial_lat=40.443236;
.initial_lon=-79.940570;
.initial_alt=4;
agent.2.command="ppac";
agent.2.command.size=1;
agent.2.command.0="region.0";
agent.2.hertz=.hertz;
@@ -0,0 +1,15 @@
.vrep_port=19909;
.initial_lat=40.443131;
.initial_lon=-79.940670;
.initial_alt=4;
agent.3.command="zone coverage";
agent.3.command.size=0;
agent.3.command.formation=.zone_coverage_formation;
agent.3.command.assets="assets";
agent.3.command.protectors="protectors";
agent.3.command.enemies="enemies";
agent.3.command.buffer=.zone_coverage_buffer;
agent.3.command.distance=.zone_coverage_distance;
agent.3.hertz=.hertz;
@@ -0,0 +1,15 @@
.vrep_port=19910;
.initial_lat=40.443131;
.initial_lon=-79.940470;
.initial_alt=4;
agent.4.command="zone coverage";
agent.4.command.size=0;
agent.4.command.formation=.zone_coverage_formation;
agent.4.command.assets="assets";
agent.4.command.protectors="protectors";
agent.4.command.enemies="enemies";
agent.4.command.buffer=.zone_coverage_buffer;
agent.4.command.distance=.zone_coverage_distance;
agent.4.hertz=.hertz;
@@ -0,0 +1,15 @@
.vrep_port=19911;
.initial_lat=40.443231;
.initial_lon=-79.940470;
.initial_alt=4;
agent.5.command="zone coverage";
agent.5.command.size=0;
agent.5.command.formation=.zone_coverage_formation;
agent.5.command.assets="assets";
agent.5.command.protectors="protectors";
agent.5.command.enemies="enemies";
agent.5.command.buffer=.zone_coverage_buffer;
agent.5.command.distance=.zone_coverage_distance;
agent.5.hertz=.hertz;
@@ -0,0 +1,15 @@
.vrep_port=19912;
.initial_lat=40.443031;
.initial_lon=-79.940470;
.initial_alt=4;
agent.6.command="zone coverage";
agent.6.command.size=0;
agent.6.command.formation=.zone_coverage_formation;
agent.6.command.assets="assets";
agent.6.command.protectors="protectors";
agent.6.command.enemies="enemies";
agent.6.command.buffer=.zone_coverage_buffer;
agent.6.command.distance=.zone_coverage_distance;
agent.6.hertz=.hertz;
@@ -0,0 +1,16 @@
.vrep_port=19913;
.initial_lat=40.443031;
.initial_lon=-79.940570;
.initial_alt=4;
agent.7.command="zone coverage";
agent.7.command.size=0;
agent.7.command.formation=.zone_coverage_formation;
agent.7.command.assets="assets";
agent.7.command.protectors="protectors";
agent.7.command.enemies="enemies";
agent.7.command.buffer.zone_coverage_buffer;
agent.7.command.buffer=.zone_coverage_buffer;
agent.7.command.distance=.zone_coverage_distance;
agent.7.hertz=.hertz;
@@ -0,0 +1,15 @@
.vrep_port=19914;
.initial_lat=40.443031;
.initial_lon=-79.940670;
.initial_alt=4;
agent.8.command="zone coverage";
agent.8.command.size=0;
agent.8.command.formation=.zone_coverage_formation;
agent.8.command.assets="assets";
agent.8.command.protectors="protectors";
agent.8.command.enemies="enemies";
agent.8.command.buffer=.zone_coverage_buffer;
agent.8.command.distance=.zone_coverage_distance;
agent.8.hertz=.hertz;
@@ -0,0 +1,19 @@
group.assets.members.size=1;
group.assets.members.0="agent.0";
group.protectors.members.size=7;
group.protectors.members.0="agent.1";
group.protectors.members.1="agent.3";
group.protectors.members.2="agent.4";
group.protectors.members.3="agent.5";
group.protectors.members.4="agent.6";
group.protectors.members.5="agent.7";
group.protectors.members.6="agent.8";
group.enemies.members.size=1;
group.enemies.members.0="agent.2";
.platform="vrep-uav";
.zone_coverage_formation="line";
.zone_coverage_buffer=2;
.zone_coverage_distance=0.5;
.hertz=.5;
@@ -0,0 +1,17 @@
#!/usr/bin/perl
use lib "$ENV{GAMS_ROOT}/scripts/simulation";
use simulation;
$gams_root = $ENV{GAMS_ROOT};
$time = 3600;
$madara_debug = 5;
$gams_debug = 5;
$period = 1;
$num = 9;
$sim = "zone_coverage_line";
$area = "small";
$border = "region.0";
$num_coverages = 0;
$launch_controllers = 1;
simulation::run($num, $time, $period, $sim, $area, $madara_debug, $gams_debug, $border, $num_coverages, $launch_controllers);
@@ -0,0 +1,9 @@
.vrep_port=19906;
.initial_lat=40.443222;
.initial_lon=-79.940334;
.initial_alt=4;
agent.0.command="null";
agent.0.command.size=0;
@@ -0,0 +1,14 @@
.vrep_port=19907;
.initial_lat=40.443131;
.initial_lon=-79.940570;
.initial_alt=4;
agent.1.command="zone coverage";
agent.1.command.size=0;
agent.1.command.formation=.zone_coverage_formation;
agent.1.command.assets="assets";
agent.1.command.protectors="protectors";
agent.1.command.enemies="enemies";
agent.1.command.buffer=.zone_coverage_buffer;
agent.1.command.distance=.zone_coverage_distance;
@@ -0,0 +1,11 @@
.vrep_port=19908;
.vrep_max_delta=0.5;
.vrep_thread_move_speed=1;
.initial_lat=40.443236;
.initial_lon=-79.940570;
.initial_alt=4;
agent.2.command="ppac";
agent.2.command.size=1;
agent.2.command.0="region.0";
@@ -0,0 +1,14 @@
.vrep_port=19909;
.initial_lat=40.443131;
.initial_lon=-79.940670;
.initial_alt=4;
agent.3.command="zone coverage";
agent.3.command.size=0;
agent.3.command.formation=.zone_coverage_formation;
agent.3.command.assets="assets";
agent.3.command.protectors="protectors";
agent.3.command.enemies="enemies";
agent.3.command.buffer=.zone_coverage_buffer;
agent.3.command.distance=.zone_coverage_distance;
@@ -0,0 +1,14 @@
.vrep_port=19910;
.initial_lat=40.443131;
.initial_lon=-79.940470;
.initial_alt=4;
agent.4.command="zone coverage";
agent.4.command.size=0;
agent.4.command.formation=.zone_coverage_formation;
agent.4.command.assets="assets";
agent.4.command.protectors="protectors";
agent.4.command.enemies="enemies";
agent.4.command.buffer=.zone_coverage_buffer;
agent.4.command.distance=.zone_coverage_distance;
@@ -0,0 +1,14 @@
.vrep_port=19911;
.initial_lat=40.443231;
.initial_lon=-79.940470;
.initial_alt=4;
agent.5.command="zone coverage";
agent.5.command.size=0;
agent.5.command.formation=.zone_coverage_formation;
agent.5.command.assets="assets";
agent.5.command.protectors="protectors";
agent.5.command.enemies="enemies";
agent.5.command.buffer=.zone_coverage_buffer;
agent.5.command.distance=.zone_coverage_distance;
@@ -0,0 +1,14 @@
.vrep_port=19912;
.initial_lat=40.443031;
.initial_lon=-79.940470;
.initial_alt=4;
agent.6.command="zone coverage";
agent.6.command.size=0;
agent.6.command.formation=.zone_coverage_formation;
agent.6.command.assets="assets";
agent.6.command.protectors="protectors";
agent.6.command.enemies="enemies";
agent.6.command.buffer=.zone_coverage_buffer;
agent.6.command.distance=.zone_coverage_distance;
@@ -0,0 +1,15 @@
.vrep_port=19913;
.initial_lat=40.443031;
.initial_lon=-79.940570;
.initial_alt=4;
agent.7.command="zone coverage";
agent.7.command.size=0;
agent.7.command.formation=.zone_coverage_formation;
agent.7.command.assets="assets";
agent.7.command.protectors="protectors";
agent.7.command.enemies="enemies";
agent.7.command.buffer.zone_coverage_buffer;
agent.7.command.buffer=.zone_coverage_buffer;
agent.7.command.distance=.zone_coverage_distance;
@@ -0,0 +1,14 @@
.vrep_port=19914;
.initial_lat=40.443031;
.initial_lon=-79.940670;
.initial_alt=4;
agent.8.command="zone coverage";
agent.8.command.size=0;
agent.8.command.formation=.zone_coverage_formation;
agent.8.command.assets="assets";
agent.8.command.protectors="protectors";
agent.8.command.enemies="enemies";
agent.8.command.buffer=.zone_coverage_buffer;
agent.8.command.distance=.zone_coverage_distance;
@@ -1,6 +1,6 @@
group.assets.members.size=1;
group.assets.members.0="agent.0";
group.protectors.members.size=14;
group.protectors.members.size=8;
group.protectors.members.0="agent.1";
group.protectors.members.1="agent.3";
group.protectors.members.2="agent.4";
@@ -0,0 +1,17 @@
#!/usr/bin/perl
use lib "$ENV{GAMS_ROOT}/scripts/simulation";
use simulation;
$gams_root = $ENV{GAMS_ROOT};
$time = 3600;
$madara_debug = 5;
$gams_debug = 5;
$period = 1;
$num = 10;
$sim = "zone_coverage_onion";
$area = "small";
$border = "region.0";
$num_coverages = 0;
$launch_controllers = 1;
simulation::run($num, $time, $period, $sim, $area, $madara_debug, $gams_debug, $border, $num_coverages, $launch_controllers);
Oops, something went wrong.

0 comments on commit bb283f0

Please sign in to comment.