Skip to content

Commit

Permalink
Updated to 10.1.1, demonstrate use of library
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebeal committed Nov 15, 2016
1 parent 8ce1ed0 commit 71ff604
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.protelis</groupId>
<artifactId>protelis-demo</artifactId>
<version>10.1.0</version>
<version>10.1.1</version>
<name>Protelis Demo</name>
<description>Example of a minimal project based on Protelis</description>
<dependencies>
<dependency>
<groupId>org.protelis</groupId>
<artifactId>protelis</artifactId>
<version>10.1.0</version>
<version>10.1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
3 changes: 3 additions & 0 deletions src/main/protelis/hello.pt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
// Just like declaring a Java package, except it ends with this file's name (sans extension)
module hello

import protelis:state:time

// Get a variable from the environment
let leader = env.has("leader");

if(leader) {
self.announce("The leader is at "+self.getDeviceUID().getUID());
self.announce("The leader's count is: "+countDownWithDecay(4,1));
} else {
// Otherwise, stay silent
false;
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/HelloTest.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
Creating grid network
Executing round 0
The leader is at 5
The leader's count is: 3.0
Executing round 1
Hello from the leader to its neighbor at 1
Hello from the leader to its neighbor at 4
The leader is at 5
The leader's count is: 2.0
Hello from the leader to its neighbor at 6
Hello from the leader to its neighbor at 9
Executing round 2
Hello from the leader to its neighbor at 1
Hello from the leader to its neighbor at 4
The leader is at 5
The leader's count is: 1.0
Hello from the leader to its neighbor at 6
Hello from the leader to its neighbor at 9
Finished executing

0 comments on commit 71ff604

Please sign in to comment.