Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Updates demos to val keyword.
Browse files Browse the repository at this point in the history
Updates demos to use `val` keyword instead of `const` (sarl/sarl#7).
  • Loading branch information
srodriguez committed Feb 13, 2014
1 parent f5ad2e5 commit 75573de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/sarl/io/sarl/demos/counter/counteragent.sarl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ event Die {
agent CounterAgent {
uses Lifecycle, Schedules, DefaultContextInteractions, Behaviors

const AtomicInteger count = new AtomicInteger

val AtomicInteger count = new AtomicInteger
on Initialize {
println("INITIALIZE: Start")
task("test-presence").every(100) [
Expand Down
4 changes: 2 additions & 2 deletions src/main/sarl/io/sarl/demos/filesearch/filesearch.sarl
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ agent FileSearchAgent {
}

on Search{
const minSize = e.minSize
val minSize = e.minSize

println(format("[ID=%s - parent %s] Searching in %s", ID, defaultContext.ID,myPath))


const File dir = new File(myPath)
val File dir = new File(myPath)
if(!dir.exists){
throw new IllegalArgumentException("Path ["+myPath+"] is not a Directory")
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/sarl/io/sarl/demos/websniffer/websniffer.sarl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ event Count{
agent Ticker{
uses DefaultContextInteractions, Schedules,Lifecycle

const AtomicInteger secs = new AtomicInteger
val AtomicInteger secs = new AtomicInteger

on Initialize {
every(100)[doCount]
Expand All @@ -28,8 +28,8 @@ agent Ticker{
emit(new Count => [count = secs.get])
}

def seconds(long val) : long{
val*1000
def seconds(long milis) : long{
milis*1000
}

}

0 comments on commit 75573de

Please sign in to comment.