Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vladislav Perepelkin
hppca
Commits
395bbdc6
Commit
395bbdc6
authored
Nov 14, 2016
by
Vladislav Perepelkin
Browse files
added series scripts
parent
6e7c727a
Changes
7
Hide whitespace changes
Inline
Side-by-side
series.sh
0 → 100644
View file @
395bbdc6
#!/bin/sh
export
WIDTH
=
500
export
HEIGHT
=
600
export
ITERS
=
101
export
INIT1
=
0.7
INIT2
=
0.7
INIT4
=
0.7
INIT8
=
0.7
export
INIT16
=
0.25
INIT32
=
0
INIT64
=
0
INIT128
=
0
export
SOURCE_WIDTH
=
20
export
SRC1
=
1
SRC2
=
1
SRC4
=
1
SRC8
=
1
export
SRC16
=
0.75
SRC32
=
0
SRC64
=
0
SRC128
=
0
export
SAVE_PERIOD
=
50
export
AVERAGING_RADIUS
=
1
export
ENSEMBLE_SIZE
=
2
export
PROB_MAIN
=
"0.1"
export
PROB_SEC
=
"0.1"
;
system/conduct.sh
export
PROB_SEC
=
"0.2"
;
system/conduct.sh
export
PROB_SEC
=
"0.3"
;
system/conduct.sh
export
PROB_SEC
=
"0.4"
;
system/conduct.sh
export
PROB_SEC
=
"0.5"
;
system/conduct.sh
export
PROB_SEC
=
"0.6"
;
system/conduct.sh
export
PROB_SEC
=
"0.7"
;
system/conduct.sh
export
PROB_SEC
=
"0.8"
;
system/conduct.sh
export
PROB_MAIN
=
"0.5"
export
PROB_SEC
=
"0.1"
;
system/conduct.sh
export
PROB_SEC
=
"0.2"
;
system/conduct.sh
export
PROB_SEC
=
"0.3"
;
system/conduct.sh
export
PROB_SEC
=
"0.4"
;
system/conduct.sh
export
PROB_MAIN
=
"0.9"
export
PROB_SEC
=
"0.05"
;
system/conduct.sh
sh system/curves_gen.sh exp
system/build_max.py
View file @
395bbdc6
...
...
@@ -16,4 +16,4 @@ for f in sys.argv[1:]:
val
=
float
(
val
)
if
top
is
None
or
val
>
top
:
top
=
val
print
top
,
print
top
system/conduct.sh
0 → 100755
View file @
395bbdc6
#!/bin/sh
# conducts whole experiment putting density max-curve to stdout
# all experiment settings must be in environment variables (see errors
# for details)
# Rules: 5<->5 and 10<->16 with prob in PROB_MAIN
# TODO: check env args
# environment variables:
# PROB_MAIN
make purge
python system/gen_rules.py
\
5-5
=
$PROB_MAIN
10-16
=
$PROB_MAIN
16-10
=
$PROB_MAIN
\
5-10
=
$PROB_SEC
10-5
=
$PROB_SEC
16-5
=
$PROB_SEC
\
>
rules.txt
||
exit
1
python system/gen_config_flatwave.py
>
config.c
||
exit
1
echo
"EXPERIMENT: PROB_MAIN=
$PROB_MAIN
PROB_SEC=
$PROB_SEC
"
make run
cwd
=
$PWD
mkdir
exp
cd
density
python ../system/build_max.py
*
.xls
>
$cwd
/exp/exp_
${
PROB_MAIN
}
_
${
PROB_SEC
}
.xls
system/curves_gen.sh
0 → 100755
View file @
395bbdc6
#!/bin/sh
zmin
=
3.2
zmax
=
5.1
tmp_script
=
`
tempfile
`
echo
'set term png
set yrange['
$zmin
':'
$zmax
']
set output '
\"
$1
/curves.png
\"
'
set grid ytics lw 1 lt 0
set grid xtics lw 1 lt 0
unset key'
>
$tmp_script
first
=
true
for
x
in
`
ls
$1
/
*
.xls
`
;
do
$first
&&
echo
"plot '
$x
' with lines lw 4
\\
"
>>
$tmp_script
$first
||
echo
", '
$x
' with lines lw 4
\\
"
>>
$tmp_script
first
=
false
done
gnuplot
$tmp_script
2>/dev/null
rm
$tmp_script
system/gen_collide.py
View file @
395bbdc6
...
...
@@ -112,7 +112,7 @@ for s0 in range(256):
if
len
(
rules
[
s0
])
>
0
:
sum_prob
=
reduce
(
lambda
x
,
y
:
x
+
y
,
[
rules
[
s0
][
s1
]
for
s1
in
rules
[
s0
]])
if
sum_prob
!=
1
:
if
abs
(
sum_prob
-
1
)
>
0.000000
1
:
error
(
"Normalization fails for state ("
+
str
(
s0
)
+
\
"), sum prob is "
+
str
(
sum_prob
))
...
...
system/gen_config_flatwave.py
View file @
395bbdc6
...
...
@@ -9,7 +9,7 @@ failed=False
for
key
in
KEYS
:
if
key
not
in
os
.
environ
:
failed
=
True
print
"ERROR: undefined environment variable:"
,
key
sys
.
stderr
.
write
(
"ERROR: undefined environment variable:"
+
str
(
key
)
+
'
\n
'
)
assert
not
failed
...
...
system/gen_rules.py
View file @
395bbdc6
...
...
@@ -33,14 +33,18 @@ for rule in sys.argv[1:]:
s1
,
s2
=
map
(
int
,
pair
.
split
(
'-'
))
if
s1
not
in
matrix
:
matrix
[
s1
]
=
dict
()
matrix
[
s1
][
s2
]
=
float
(
prob
)
try
:
matrix
[
s1
][
s2
]
=
float
(
prob
)
except
ValueError
:
raise
Exception
(
'Illegal rule format'
,
rule
)
assert
0
<=
float
(
prob
)
<=
1
for
cls
in
CLASSES
:
for
s1
in
cls
:
if
s1
not
in
matrix
:
matrix
[
s1
]
=
dict
()
matrix
[
s1
][
s1
]
=
1
for
s
in
cls
[:
-
1
]:
matrix
[
s1
][
s
]
=
1.0
/
len
(
cls
)
sum
=
0
for
s2
in
cls
:
if
s2
in
matrix
[
s1
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment