-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
230 lines (205 loc) · 9.25 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build" name="pastry-push-sum">
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<path id="classpath">
<pathelement location="bin"/>
<pathelement location="lib/commons-io-2.4/commons-io-2.4.jar"/>
<pathelement location="lib/commons-lang3-3.1/commons-lang3-3.1.jar"/>
<pathelement location="lib/commons-math3-3.2/commons-math3-3.2.jar"/>
<pathelement location="lib/freepastry-2.1/FreePastry-2.1.jar"/>
<pathelement location="lib/jcommander-1.30/jcommander-1.30.jar"/>
</path>
<!-- === clean targets === -->
<target name="clean" description="Delete build artifacts and documentation.">
<delete dir="bin"/>
<delete dir="doc"/>
</target>
<target name="clean-plot" description="Delete plot data and images.">
<delete dir="plot"/>
</target>
<target name="clean-all" depends="clean,clean-plot" description="Delete build artifacts, documentation and plots."/>
<!-- === build targets === -->
<target name="build" description="Compile the Java classes.">
<mkdir dir="bin"/>
<javac classpathref="classpath" debug="true" debuglevel="${debuglevel}" srcdir="src" destdir="bin" includeantruntime="false" source="${source}" target="${target}"/>
</target>
<target name="docs" depends="build" description="Create the Javadoc.">
<javadoc classpathref="classpath" packagenames="*" sourcepath="src" destdir="doc" additionalparam="-notimestamp">
<link href="http://docs.oracle.com/javase/6/docs/api/"/>
<link href="http://commons.apache.org/proper/commons-io/javadocs/api-2.4/"/>
<link href="http://commons.apache.org/proper/commons-lang/javadocs/api-3.1/"/>
<link href="http://commons.apache.org/proper/commons-math/javadocs/api-3.2/"/>
<link href="http://www.freepastry.org/FreePastry/javadoc/"/>
<link href="http://jcommander.org/apidocs/"/>
</javadoc>
</target>
<!-- === example run targets === -->
<target name="run-three-peers" depends="build" description="Run an example with three instances of PPSPeer in parallel.">
<parallel>
<sequential>
<java classname="univie.cs.pps.PPSPeer" classpathref="classpath" failonerror="true" fork="yes">
<arg line="-b=9001 -p=9001"/>
</java>
</sequential>
<sequential>
<sleep seconds="1"/>
<java classname="univie.cs.pps.PPSPeer" classpathref="classpath" failonerror="true" fork="yes">
<arg line="-b=9001 -p=9002"/>
</java>
</sequential>
<sequential>
<sleep seconds="2"/>
<java classname="univie.cs.pps.PPSPeer" classpathref="classpath" failonerror="true" fork="yes">
<arg line="-b=9001 -p=9004"/>
</java>
</sequential>
</parallel>
</target>
<target name="run-simulator" depends="build" description="Run an example simulation with PPSSimulator.">
<java classname="univie.cs.pps.PPSSimulator" classpathref="classpath" failonerror="true" fork="yes">
<arg value="-n=10"/>
<arg value="-s=100"/>
<arg value="-r=0"/>
<arg value="-u=50"/>
<arg value="--variateStd=0"/>
<arg value="-j=0"/>
<arg value="-l=0"/>
<arg value="--min=0"/>
<arg value="--max=10"/>
<arg value="--resetInterval=0"/>
<arg value="-v=2"/>
</java>
</target>
<!-- === plot targets === -->
<property name="ext" value="png" description="Plot image type: png or svg."/>
<property name="key" value="1" description="Plot with legend (1) or without (0)."/>
<condition property="gnuplot_bin" value="gnuplot.exe" else="gnuplot">
<os family="windows"/>
</condition>
<target name="-sim" depends="build">
<java classname="univie.cs.pps.PPSSimulator" classpathref="classpath" failonerror="true" fork="yes">
<arg value="-n=${nodes}"/>
<arg value="-s=${steps}"/>
<arg value="-r=${randomSeed}"/>
<arg value="-u=${updateInterval}"/>
<arg value="--variateStd=${variateStd}"/>
<arg value="-j=${joinInterval}"/>
<arg value="-l=${leaveInterval}"/>
<arg value="--min=${min}"/>
<arg value="--max=${max}"/>
<arg value="--resetInterval=${resetInterval}"/>
<arg value="-v=2"/>
<arg value="-o=${data}"/>
</java>
</target>
<target name="-plot" depends="-sim">
<exec executable="${gnuplot_bin}" failonerror="true">
<arg line="-e "IMG='${img}';TERM='${ext}';DATA='${data}';STEPSIZE=1000;STEPS=${steps};TITLE='${title}';KEY=${key}" ./plot.p"/>
</exec>
</target>
<target name="plot-n10" description="Simulate and plot: 10 Nodes; No Variation.">
<antcall target="-plot">
<param name="data" value="plot/n100.data"/>
<param name="img" value="plot/n100.${ext}"/>
<param name="title" value="10 Nodes; No Variation"/>
<param name="nodes" value="10" />
<param name="steps" value="100" />
<param name="randomSeed" value="0" />
<param name="updateInterval" value="50" />
<param name="variateStd" value="0" />
<param name="joinInterval" value="0" />
<param name="leaveInterval" value="0" />
<param name="min" value="0" />
<param name="max" value="10" />
<param name="resetInterval" value="0" />
</antcall>
</target>
<target name="plot-n100j100" description="Simulate and plot: 100 Nodes; 1 Node Joining/100 Steps.">
<antcall target="-plot">
<param name="data" value="plot/n100j100.data"/>
<param name="img" value="plot/n100j100.${ext}"/>
<param name="title" value="100 Nodes; 1 Node Joining/100 Steps"/>
<param name="nodes" value="100" />
<param name="steps" value="500" />
<param name="randomSeed" value="0" />
<param name="updateInterval" value="50" />
<param name="variateStd" value="0" />
<param name="joinInterval" value="100" />
<param name="leaveInterval" value="0" />
<param name="min" value="0" />
<param name="max" value="10" />
<param name="resetInterval" value="0" />
</antcall>
</target>
<target name="plot-n100j10" description="Simulate and plot: 100 Nodes; 1 Node Joining/10 Steps.">
<antcall target="-plot">
<param name="data" value="plot/n100j10.data"/>
<param name="img" value="plot/n100j10.${ext}"/>
<param name="title" value="100 Nodes; 1 Node Joining/10 Steps"/>
<param name="nodes" value="100" />
<param name="steps" value="500" />
<param name="randomSeed" value="0" />
<param name="updateInterval" value="50" />
<param name="variateStd" value="0" />
<param name="joinInterval" value="10" />
<param name="leaveInterval" value="0" />
<param name="min" value="0" />
<param name="max" value="10" />
<param name="resetInterval" value="0" />
</antcall>
</target>
<target name="plot-n10v100" description="Simulate and plot: 10 Nodes; Value Variation/100 Steps.">
<antcall target="-plot">
<param name="data" value="plot/n10v100.data"/>
<param name="img" value="plot/n10v100.${ext}"/>
<param name="title" value="10 Nodes; Value Variation/100 Steps"/>
<param name="nodes" value="10" />
<param name="steps" value="500" />
<param name="randomSeed" value="0" />
<param name="updateInterval" value="100" />
<param name="variateStd" value="1" />
<param name="joinInterval" value="0" />
<param name="leaveInterval" value="0" />
<param name="min" value="0" />
<param name="max" value="10" />
<param name="resetInterval" value="0" />
</antcall>
</target>
<target name="plot-n10v100j50" description="Simulate and plot: 10 Nodes; Value Variation/100 Steps, 1 Node Joining/50 Steps.">
<antcall target="-plot">
<param name="data" value="plot/n10v100j50.data"/>
<param name="img" value="plot/n10v100j50.${ext}"/>
<param name="title" value="10 Nodes; Value Variation/100 Steps, 1 Node Joining/50 Steps"/>
<param name="nodes" value="10" />
<param name="steps" value="500" />
<param name="randomSeed" value="0" />
<param name="updateInterval" value="100" />
<param name="variateStd" value="1" />
<param name="joinInterval" value="50" />
<param name="leaveInterval" value="0" />
<param name="min" value="0" />
<param name="max" value="10" />
<param name="resetInterval" value="0" />
</antcall>
</target>
<target name="plot-n10v100j50l75" description="Simulate and plot: 10 Nodes; Value Variation/100 Steps, 1 Node Joining/50 Steps; 1 Node Leaving/75 Stepss.">
<antcall target="-plot">
<param name="data" value="plot/n10v100j50l75.data"/>
<param name="img" value="plot/n10v100j50l75.${ext}"/>
<param name="title" value="10 Nodes; Value Variation/100 Steps, 1 Node Joining/50 Steps; 1 Node Leaving/75 Steps"/>
<param name="nodes" value="10" />
<param name="steps" value="500" />
<param name="randomSeed" value="0" />
<param name="updateInterval" value="100" />
<param name="variateStd" value="1" />
<param name="joinInterval" value="50" />
<param name="leaveInterval" value="75" />
<param name="min" value="0" />
<param name="max" value="10" />
<param name="resetInterval" value="250" />
</antcall>
</target>
<target name="all-plots" depends="clean-plot,plot-n10,plot-n100j100,plot-n100j10,plot-n10v100,plot-n10v100j50,plot-n10v100j50l75" description="Simulate and plot all parameter sets."/>
</project>