Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 96 lines (59 sloc) 3.245 kb
2a23b9d2 »
2010-05-12 fix instructions
1 Ants
2 ====
76bc1a33 »
2010-05-12 sbt config and structure
3
2a23b9d2 »
2010-05-12 fix instructions
4 Ants is based on the Clojure [ants simulation][ants.clj] by Rich Hickey, and ported to Scala using [Akka][akka].
76bc1a33 »
2010-05-12 sbt config and structure
5
e61614ac »
2010-05-20 comments
6
5b027dc9 »
2010-05-15 sort out sbt build and assembly
7 Note that there is an "offical" akka port of the Clojure Ants by Peter Vlugter
8 [here][peter-ants] which is/was stunningly beautiful in its design.
9148d1ff »
2010-05-12 comments
9
f744412f »
2010-05-14 minor
10 I have copied a lot of Peter's code. So, it's similar in many ways,
9148d1ff »
2010-05-12 comments
11
f744412f »
2010-05-14 minor
12 But my version:
13
14 * Uses Swing rather than SPDE
5b027dc9 »
2010-05-15 sort out sbt build and assembly
15 * Other minor stylistic/naming differences.
16
f744412f »
2010-05-14 minor
17 Also
5b027dc9 »
2010-05-15 sort out sbt build and assembly
18
f744412f »
2010-05-14 minor
19 * In Peter's version, the ants use a Ref to track their location. In my version, Refs are used only in the world of cells.
20 (like the clojure code). The ants current location is passed in the in self!behave message. (I am not sure that there is
21 any great value in this difference between my and Peter's version).
5b027dc9 »
2010-05-15 sort out sbt build and assembly
22 * The random selection of movement in moveToRandomCellWeightedByRank is achieved, like in Clojure, using a random selection from a
23 list of three partially applied functions. This is just to show you can!
f744412f »
2010-05-14 minor
24 Peter's version uses a neat if, (and is all the clearer for it).
25 * There are two local var in Peter's roulette function. In my equivalent wrand function, I use recursion, as per the Clojure code.
9148d1ff »
2010-05-12 comments
26
27
2a23b9d2 »
2010-05-12 fix instructions
28 [ants.clj]:http://clojure.googlegroups.com/web/ants.clj
29 [akka]:http://akkasource.org
d1a4fe57 »
2010-05-15 added application image
30 [bug]:https://www.assembla.com/spaces/akka/tickets/187-problem-with-actor-starvation
5b027dc9 »
2010-05-15 sort out sbt build and assembly
31 [peter-ants]:http://github.com/pvlugter/ants
2a23b9d2 »
2010-05-12 fix instructions
32
33 Requirements
34 ------------
35
5b027dc9 »
2010-05-15 sort out sbt build and assembly
36 To build and run Ants you need [Simple Build Tool][sbt] (sbt). I used SBT version 0.7.3.
2a23b9d2 »
2010-05-12 fix instructions
37
38 [sbt]: http://code.google.com/p/simple-build-tool/
39
40
78261261 »
2010-05-15 icon
41 Ants also _requires the latest Akka_. To build a local version of Akka Core.
2a23b9d2 »
2010-05-12 fix instructions
42
43 git clone http://github.com/jboner/akka.git
44 cd akka
45 sbt "project akka-core" update publish-local
46
47
78261261 »
2010-05-15 icon
48 (I am using git on Windows 7 64bit using [msysgit] which works well for me.)
5b027dc9 »
2010-05-15 sort out sbt build and assembly
49
50 [msysgit]:http://msysgit.googlecode.com/files/msysGit-netinstall-1.7.0.2-preview20100407-2.exe
51
2a23b9d2 »
2010-05-12 fix instructions
52 Running
53 -------
54
78261261 »
2010-05-15 icon
55 Fetch this project with
56
57 git clone http://github.com/azzoti/ScalaAkkaAnts.git
58
2a23b9d2 »
2010-05-12 fix instructions
59 First time, sbt update to get dependencies:
60
61 sbt update
62
52a4eb0e »
2010-05-20 fix for latest akka
63 To run Ants use "sbt run":
2a23b9d2 »
2010-05-12 fix instructions
64
65 sbt run
66
530e1a9c »
2010-05-15 rename assembly and document
67 Self-contained jar
68 ------------------
2a23b9d2 »
2010-05-12 fix instructions
69
530e1a9c »
2010-05-15 rename assembly and document
70 Rather than building from source there is also a self-contained jar in the Downloads section. Run with:
71
52a4eb0e »
2010-05-20 fix for latest akka
72 java -Xmx512m -jar ants-runnable-0.3.jar
530e1a9c »
2010-05-15 rename assembly and document
73
74 To build this jar using sbt use
75
35b2f80b »
2010-05-15 formatting
76 sbt assembly
2a23b9d2 »
2010-05-12 fix instructions
77
da96e787 »
2010-05-19 broken
78 IMPORTANT When running "sbt assembly" I had to use the following jvm arguments -Xmx512M -Xss2m.
79 The -Xss2m is NON STANDARD for the default sbt install. Its reequired to avoid a stack trace when
80 unzipping the main scala jar
81
2a23b9d2 »
2010-05-12 fix instructions
82
83 Notice
84 ------
85
86 Ants is based on the Clojure ants simulation by Rich Hickey.
87
88 Copyright (c) Rich Hickey. All rights reserved.
89 The use and distribution terms for this software are covered by the
90 Common Public License 1.0 ([http://opensource.org/licenses/cpl1.0.php][cpl])
91 which can be found in the file cpl.txt at the root of this distribution.
92 By using this software in any fashion, you are agreeing to be bound by
93 the terms of this license.
94 You must not remove this notice, or any other, from this software.
95
96 [cpl]: http://opensource.org/licenses/cpl1.0.php
Something went wrong with that request. Please try again.