run-sim.sh 1.76 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#!/bin/bash

set -e

for a in "$@"; do
    if [ "$a" == "--help" ]; then
        cat <<EOF
Usage: $0 [ARGUMENTS]

Invokes ./creativity-cli via ./creativity-random, using a suitable set of
11
randomized parameters.
12

13 14
Output is placed in ./results/DATE~~HASH/randomized/creativity-SEED.crstate.xz
where DATE and HASH are generated from the current git commit date and hash.
15 16 17 18 19
EOF
        exit 1;
    fi
done

20
dir="./results/$(git show -s --date=short --format=%cd~~%h @)/randomized"
21 22
mkdir -p "$dir"

23
exec nice ./creativity-random ./creativity-cli \
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    --readers 'iU[100,200]' \
    --density 'U[0.25,4]' \
    --reader-step-mean 'U[.1,.9]' \
    --book-distance-mean '0' \
    --book-quality-sd '0' \
    --creation-fixed 'U[50,250]' \
    --creation-time 'iU[0,5]' \
    --reader-creation-scale-min 0 \
    --reader-creation-scale-range 'U[5,15]' \
    --cost-market 'U[0,50]' \
    --cost-unit 'U[0,10]' \
    --cost-piracy 'U[0,10]' \
    --initial-prob-write 'U[0.1,0.4]' \
    --initial-effort-min 'U[0,50]' \
    --initial-effort-range 'U[10,100]' \
    --initial-price-min 'U[0,10]' \
    --initial-price-range 'U[10,40]' \
    --initial-prob-keep 'U[0.25,0.75]' \
    --initial-keep-price 'U[0.25,0.75]' \
    --piracy-link-proportion 'U[0.05,0.25]' \
44
    --policy '{public-sharing,catch-pirates,public-voting}' \
45
    --public-sharing-tax 'U[1,100]' \
46 47
    --public-voting-tax 'U[1,100]' \
    --public-voting-votes 'iU[1,5]' \
48 49 50 51 52 53 54 55 56 57 58
    --catch-tax 'U[1,100]' \
    --catch-cost '0' \
    --catch-fine-const '0' \
    --catch-fine-lin 'U[0,100]' \
    --catch-fine-sq '0' \
    --catch-mu-const '10' \
    --catch-mu-lin '-0.1' \
    --catch-mu-sq '0' \
    --catch-sigma-const '3' \
    --catch-sigma-lin '0' \
    --catch-sigma-sq '0' \
59 60 61
    --threads 0 \
    --output "$dir/creativity-SEED.crstate" \
    "$@"