projects
/
ii-simulations.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9336df
)
Generate data for simulations
author
Richard Whitehouse
<github@richardwhiuk.com>
Fri, 20 May 2011 14:20:24 +0000
(15:20 +0100)
committer
Richard Whitehouse
<github@richardwhiuk.com>
Fri, 20 May 2011 14:20:24 +0000
(15:20 +0100)
data
[new file with mode: 0755]
patch
|
blob
diff --git a/data
b/data
new file mode 100755
(executable)
index 0000000..
2fc1de3
--- /dev/null
+++ b/
data
@@ -0,0
+1,28
@@
+#!/usr/bin/php
+<?php
+
+$simulation = 7;
+$hosts = 24;
+$packets = 2;
+$target = 0;
+
+for($switch = 2; $switch < 32; $switch ++){
+
+ $hmax = $switch*$switch*$hosts;
+
+ $stream = fopen("$simulation-$switch/data", "w");
+
+ fwrite($stream, "ns-moose\n2\r\n1\r\n");
+
+ echo "---- \r\n $switch \r\n---\r\n";
+
+ for($source = 1; $source < $hmax; $source ++){
+
+ fwrite($stream, "0 $source $target $packets \r\n");
+
+ }
+
+ fclose($stream);
+
+}
+