Skip to content

Commit 9fc24da

Browse files
author
Thi Nguyen
committed
Initial commit
0 parents  commit 9fc24da

File tree

812 files changed

+209516
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

812 files changed

+209516
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
jar/
2+
*.class

CHANGES

+2,751
Large diffs are not rendered by default.

LICENSE

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
Most of MASON is licensed under the Academic Free License, version 3.0,
2+
with the exception of the following files:
3+
4+
PngEncoder.java Artistic License
5+
MovieEncoder.java [Partial] Sun Open Source License
6+
WireFrameBoxPortrayal3D.java [Partial] Sun Open Source License
7+
ToolTipBehavior.java [Partial] Sun Open Source License
8+
SelectionBehavior.java [Partial] Sun Open Source License
9+
GullCG.java Sun Open Source License
10+
MersenneTwisterFast.java BSD License
11+
12+
For all remaining files, the Academic Free License is specified below.
13+
14+
15+
Academic Free License ("AFL") v. 3.0
16+
17+
This Academic Free License (the "License") applies to any original work
18+
of authorship (the "Original Work") whose owner (the "Licensor") has
19+
placed the following licensing notice adjacent to the copyright notice
20+
for the Original Work:
21+
22+
Licensed under the Academic Free License version 3.0
23+
24+
1) Grant of Copyright License. Licensor grants You a worldwide,
25+
royalty-free, non-exclusive, sublicensable license, for the duration of
26+
the copyright, to do the following:
27+
28+
a) to reproduce the Original Work in copies, either alone or as
29+
part of a collective work;
30+
31+
b) to translate, adapt, alter, transform, modify, or arrange the
32+
Original Work, thereby creating derivative works ("Derivative
33+
Works") based upon the Original Work;
34+
35+
c) to distribute or communicate copies of the Original Work and
36+
Derivative Works to the public, UNDER ANY LICENSE OF YOUR
37+
CHOICE THAT DOES NOT CONTRADICT THE TERMS AND CONDITIONS,
38+
INCLUDING LICENSOR'S RESERVED RIGHTS AND REMEDIES, IN THIS
39+
ACADEMIC FREE LICENSE;
40+
41+
d) to perform the Original Work publicly; and
42+
43+
e) to display the Original Work publicly.
44+
45+
2) Grant of Patent License. Licensor grants You a worldwide,
46+
royalty-free, non-exclusive, sublicensable license, under patent claims
47+
owned or controlled by the Licensor that are embodied in the Original
48+
Work as furnished by the Licensor, for the duration of the patents, to
49+
make, use, sell, offer for sale, have made, and import the Original Work
50+
and Derivative Works.
51+
52+
3) Grant of Source Code License. The term "Source Code" means the
53+
preferred form of the Original Work for making modifications to it and
54+
all available documentation describing how to modify the Original Work.
55+
Licensor agrees to provide a machine-readable copy of the Source Code of
56+
the Original Work along with each copy of the Original Work that
57+
Licensor distributes. Licensor reserves the right to satisfy this
58+
obligation by placing a machine-readable copy of the Source Code in an
59+
information repository reasonably calculated to permit inexpensive and
60+
convenient access by You for as long as Licensor continues to distribute
61+
the Original Work.
62+
63+
4) Exclusions From License Grant. Neither the names of Licensor, nor the
64+
names of any contributors to the Original Work, nor any of their
65+
trademarks or service marks, may be used to endorse or promote products
66+
derived from this Original Work without express prior permission of the
67+
Licensor. Except as expressly stated herein, nothing in this License
68+
grants any license to Licensor's trademarks, copyrights, patents, trade
69+
secrets or any other intellectual property. No patent license is granted
70+
to make, use, sell, offer for sale, have made, or import embodiments of
71+
any patent claims other than the licensed claims defined in Section 2.
72+
No license is granted to the trademarks of Licensor even if such marks
73+
are included in the Original Work. Nothing in this License shall be
74+
interpreted to prohibit Licensor from licensing under terms different
75+
from this License any Original Work that Licensor otherwise would have a
76+
right to license.
77+
78+
5) External Deployment. The term "External Deployment" means the use,
79+
distribution, or communication of the Original Work or Derivative Works
80+
in any way such that the Original Work or Derivative Works may be used
81+
by anyone other than You, whether those works are distributed or
82+
communicated to those persons or made available as an application
83+
intended for use over a network. As an express condition for the grants
84+
of license hereunder, You must treat any External Deployment by You of
85+
the Original Work or a Derivative Work as a distribution under section
86+
1(c).
87+
88+
6) Attribution Rights. You must retain, in the Source Code of any
89+
Derivative Works that You create, all copyright, patent, or trademark
90+
notices from the Source Code of the Original Work, as well as any
91+
notices of licensing and any descriptive text identified therein as an
92+
"Attribution Notice." You must cause the Source Code for any Derivative
93+
Works that You create to carry a prominent Attribution Notice reasonably
94+
calculated to inform recipients that You have modified the Original
95+
Work.
96+
97+
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants
98+
that the copyright in and to the Original Work and the patent rights
99+
granted herein by Licensor are owned by the Licensor or are sublicensed
100+
to You under the terms of this License with the permission of the
101+
contributor(s) of those copyrights and patent rights. Except as
102+
expressly stated in the immediately preceding sentence, the Original
103+
Work is provided under this License on an "AS IS" BASIS and WITHOUT
104+
WARRANTY, either express or implied, including, without limitation, the
105+
warranties of non-infringement, merchantability or fitness for a
106+
particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL
107+
WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential
108+
part of this License. No license to the Original Work is granted by this
109+
License except under this disclaimer.
110+
111+
8) Limitation of Liability. Under no circumstances and under no legal
112+
theory, whether in tort (including negligence), contract, or otherwise,
113+
shall the Licensor be liable to anyone for any indirect, special,
114+
incidental, or consequential damages of any character arising as a
115+
result of this License or the use of the Original Work including,
116+
without limitation, damages for loss of goodwill, work stoppage,
117+
computer failure or malfunction, or any and all other commercial damages
118+
or losses. This limitation of liability shall not apply to the extent
119+
applicable law prohibits such limitation.
120+
121+
9) Acceptance and Termination. If, at any time, You expressly assented
122+
to this License, that assent indicates your clear and irrevocable
123+
acceptance of this License and all of its terms and conditions. If You
124+
distribute or communicate copies of the Original Work or a Derivative
125+
Work, You must make a reasonable effort under the circumstances to
126+
obtain the express assent of recipients to the terms of this License.
127+
This License conditions your rights to undertake the activities listed
128+
in Section 1, including your right to create Derivative Works based upon
129+
the Original Work, and doing so without honoring these terms and
130+
conditions is prohibited by copyright law and international treaty.
131+
Nothing in this License is intended to affect copyright exceptions and
132+
limitations (including "fair use" or "fair dealing"). This License shall
133+
terminate immediately and You may no longer exercise any of the rights
134+
granted to You by this License upon your failure to honor the conditions
135+
in Section 1(c).
136+
137+
10) Termination for Patent Action. This License shall terminate
138+
automatically and You may no longer exercise any of the rights granted
139+
to You by this License as of the date You commence an action, including
140+
a cross-claim or counterclaim, against Licensor or any licensee alleging
141+
that the Original Work infringes a patent. This termination provision
142+
shall not apply for an action alleging patent infringement by
143+
combinations of the Original Work with other software or hardware.
144+
145+
11) Jurisdiction, Venue and Governing Law. Any action or suit relating
146+
to this License may be brought only in the courts of a jurisdiction
147+
wherein the Licensor resides or in which Licensor conducts its primary
148+
business, and under the laws of that jurisdiction excluding its
149+
conflict-of-law provisions. The application of the United Nations
150+
Convention on Contracts for the International Sale of Goods is expressly
151+
excluded. Any use of the Original Work outside the scope of this License
152+
or after its termination shall be subject to the requirements and
153+
penalties of copyright or patent law in the appropriate jurisdiction.
154+
This section shall survive the termination of this License.
155+
156+
12) Attorneys' Fees. In any action to enforce the terms of this License
157+
or seeking damages relating thereto, the prevailing party shall be
158+
entitled to recover its costs and expenses, including, without
159+
limitation, reasonable attorneys' fees and costs incurred in connection
160+
with such action, including any appeal of such action. This section
161+
shall survive the termination of this License.
162+
163+
13) Miscellaneous. If any provision of this License is held to be
164+
unenforceable, such provision shall be reformed only to the extent
165+
necessary to make it enforceable.
166+
167+
14) Definition of "You" in This License. "You" throughout this License,
168+
whether in upper or lower case, means an individual or a legal entity
169+
exercising rights under, and complying with all of the terms of, this
170+
License. For legal entities, "You" includes any entity that controls, is
171+
controlled by, or is under common control with you. For purposes of this
172+
definition, "control" means (i) the power, direct or indirect, to cause
173+
the direction or management of such entity, whether by contract or
174+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
175+
outstanding shares, or (iii) beneficial ownership of such entity.
176+
177+
15) Right to Use. You may use the Original Work in all ways not
178+
otherwise restricted or conditioned by this License or by law, and
179+
Licensor promises not to interfere with or be responsible for such uses
180+
by You.
181+
182+
16) Modification of This License. This License is Copyright (c) 2005
183+
Lawrence Rosen. Permission is granted to copy, distribute, or
184+
communicate this License without modification. Nothing in this License
185+
permits You to modify this License as applied to the Original Work or to
186+
Derivative Works. However, You may modify the text of this License and
187+
copy, distribute or communicate your modified version (the "Modified
188+
License") and apply it to other original works of authorship subject to
189+
the following conditions: (i) You may not indicate in any way that your
190+
Modified License is the "Academic Free License" or "AFL" and you may not
191+
use those names in the name of your Modified License; (ii) You must
192+
replace the notice specified in the first paragraph above with the
193+
notice "Licensed under <insert your license name here>" or with a notice
194+
of your own that is not confusingly similar to the notice in this
195+
License; and (iii) You may not claim that your original works are open
196+
source software unless your Modified License has been approved by Open
197+
Source Initiative (OSI) and You comply with its license review and
198+
certification process.
199+

Makefile

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
### MASON Makefile
2+
#### By Sean Luke
3+
4+
#### Relevant Stuff:
5+
#### To see all your make options: type make help
6+
#### To add flags (like -O) to javac: change the FLAGS variable below
7+
8+
JAVAC = javac ${FLAGS}
9+
10+
FLAGS = -target 1.5 -source 1.5 -g -nowarn
11+
12+
VERSION = 18
13+
14+
15+
# Main java files, not including the 3D stuff
16+
DIRS = \
17+
sim/app/heatbugs/*.java\
18+
sim/app/hexabugs/*.java \
19+
sim/app/asteroids/*.java \
20+
sim/app/antsforage/*.java \
21+
sim/app/virus/*.java \
22+
sim/app/cto/*.java \
23+
sim/app/woims/*.java \
24+
sim/app/mav/*.java \
25+
sim/app/mousetraps/*.java \
26+
sim/app/networktest/*.java \
27+
sim/app/keepaway/*.java \
28+
sim/app/lsystem/*.java \
29+
sim/app/lightcycles/*.java \
30+
sim/app/swarmgame/*.java \
31+
sim/app/flockers/*.java \
32+
sim/app/tutorial1and2/*.java \
33+
sim/app/tutorial3/*.java \
34+
sim/app/tutorial4/*.java \
35+
sim/app/tutorial5/*.java \
36+
sim/app/schelling/*.java \
37+
sim/app/pacman/*.java \
38+
sim/app/pso/*.java \
39+
sim/app/wcss/tutorial0*/*.java \
40+
sim/app/wcss/tutorial10/*.java \
41+
sim/app/wcss/tutorial11/*.java \
42+
sim/app/wcss/tutorial12/*.java \
43+
sim/app/wcss/tutorial13/*.java \
44+
sim/display/*.java \
45+
sim/engine/*.java \
46+
sim/util/*.java \
47+
sim/util/media/*.java \
48+
sim/util/media/chart/*.java \
49+
sim/util/gui/*.java \
50+
sim/util/distribution/*.java \
51+
sim/field/*.java \
52+
sim/field/grid/*.java \
53+
sim/field/continuous/*.java \
54+
sim/field/network/*.java \
55+
sim/portrayal/*.java \
56+
sim/portrayal/grid/*.java \
57+
sim/portrayal/continuous/*.java \
58+
sim/portrayal/network/*.java \
59+
sim/portrayal/simple/*.java \
60+
sim/portrayal/inspector/*.java \
61+
ec/util/*.java \
62+
63+
64+
# The additional 3D java files
65+
3DDIRS = \
66+
sim/app/heatbugs3d/*.java \
67+
sim/app/woims3d/*.java \
68+
sim/app/mousetraps3d/*.java \
69+
sim/app/crowd3d/*.java \
70+
sim/app/balls3d/*.java \
71+
sim/app/celegans/*.java \
72+
sim/app/particles3d/*.java \
73+
sim/app/pso3d/*.java \
74+
sim/app/tutorial6/*.java \
75+
sim/app/tutorial7/*.java \
76+
sim/app/celegans/*.java \
77+
sim/app/wcss/tutorial14/*.java \
78+
sim/portrayal3d/*.java \
79+
sim/portrayal3d/simple/*.java \
80+
sim/portrayal3d/grid/*.java \
81+
sim/portrayal3d/grid/quad/*.java \
82+
sim/portrayal3d/continuous/*.java \
83+
sim/portrayal3d/network/*.java \
84+
sim/portrayal3d/inspector/*.java \
85+
sim/display3d/*.java \
86+
87+
88+
# Make the main MASON code, not including 3D code
89+
all:
90+
@ echo This makes the 2D MASON code.
91+
@ echo To learn about other options, type 'make help'
92+
@ echo
93+
${JAVAC} ${DIRS}
94+
95+
# Make the main MASON code AND the 3D code
96+
3d:
97+
${JAVAC} ${DIRS} ${3DDIRS}
98+
99+
100+
# Delete all jmf gunk, checkpoints, backup emacs gunk classfiles,
101+
# documentation, and odd MacOS X poops
102+
clean:
103+
find . -name "*.class" -exec rm -f {} \;
104+
find . -name "jmf.log" -exec rm -f {} \;
105+
find . -name ".DS_Store" -exec rm -f {} \;
106+
find . -name "*.checkpoint" -exec rm -f {} \;
107+
find . -name "*.java*~" -exec rm -f {} \;
108+
find . -name ".#*" -exec rm -rf {} \;
109+
rm -rf jar/*.jar docs/classdocs/resources docs/classdocs/ec docs/classdocs/sim docs/classdocs/*.html docs/classdocs/*.css docs/classdocs/package*
110+
111+
112+
# Build the class docs. They're located in docs/classdocs
113+
doc:
114+
javadoc -classpath . -protected -d docs/classdocs sim.display sim.engine sim.util sim.util.gui sim.util.media sim.util.media.chart sim.field sim.field.grid sim.field.continuous sim.field.network sim.portrayal sim.portrayal.grid sim.portrayal.continuous sim.portrayal.network sim.portrayal.simple ec.util sim.portrayal3d sim.portrayal3d.grid sim.portrayal3d.continuous sim.portrayal3d.simple sim.portrayal3d.grid.quad sim.display3d sim.util.distribution
115+
116+
docs: doc
117+
118+
# Build an applet jar file. Note this collects ALL .class, .png, .jpg, index.html, and simulation.classes
119+
# files. you'll probably want to strip this down some.
120+
jar: 3d
121+
touch /tmp/manifest.add
122+
rm /tmp/manifest.add
123+
echo "Main-Class: sim.display.Console" > /tmp/manifest.add
124+
jar -cvfm jar/mason.${VERSION}.jar /tmp/manifest.add `find . -name "*.class"` `find sim -name "*.jpg"` `find sim -name "*.png"` `find sim -name "*.pbm"` `find sim -name "index.html"` sim/display/simulation.classes sim/portrayal/inspector/propertyinspector.classes
125+
126+
# Build a distribution. Cleans, builds 3d, then builds docs, then
127+
# removes SVN directories
128+
dist: clean 3d indent doc jar
129+
touch TODO
130+
rm TODO
131+
find . -name ".svn" -exec rm -rf {} \;
132+
@ echo "If there were SVN directories, expect this to end in an error."
133+
@ echo "Don't worry about it, things are still fine."
134+
135+
136+
# Indent to your preferred brace format using emacs. MASON's default
137+
# format is Whitesmiths at 4 spaces. Yes, I know. Idiosyncratic.
138+
# Anyway, beware that this is quite slow. But it works!
139+
indent:
140+
touch ${HOME}/.emacs
141+
find . -name "*.java" -print -exec emacs --batch --load ~/.emacs --eval='(progn (find-file "{}") (mark-whole-buffer) (setq indent-tabs-mode nil) (untabify (point-min) (point-max)) (indent-region (point-min) (point-max) nil) (save-buffer))' \;
142+
143+
144+
# Print a help message
145+
help:
146+
@ echo MASON Makefile options
147+
@ echo
148+
@ echo "make Builds the model core, utilities, and 2D code/apps only"
149+
@ echo "make all (Same thing)"
150+
@ echo "make 3d Builds the model core, utilities, and both 2D and 3D code/apps"
151+
@ echo "make docs Builds the class documentation, found in docs/classsdocs"
152+
@ echo "make doc (Same thing)"
153+
@ echo "make clean Cleans out all classfiles, checkpoints, and various gunk"
154+
@ echo "make dist Does a make clean, make docs, and make 3d, then deletes SVN dirs"
155+
@ echo "make jar Makes 3d, then collects ALL class files into a jar file"
156+
@ echo " called mason.jar. Heavyweight -- all class files included."
157+
158+
@ echo "make help Brings up this message!"
159+
@ echo "make indent Uses emacs to re-indent MASON java files as you'd prefer"
160+

0 commit comments

Comments
 (0)