Skip to content

Commit

Permalink
Correction of error: now max transitions integrated into NumConnectio…
Browse files Browse the repository at this point in the history
…ns variable
  • Loading branch information
aligot committed Mar 19, 2018
1 parent 9c20899 commit 3219fd0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions optimization/example/grammar_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ function print_syntax() {
# Write description of state
function write_state() {
INDEX=$1
NB_TRANS=$2
echo "S$INDEX \"--s$INDEX \" c (0,1,2,3,4,5) | as.numeric(NumStates)>$INDEX " >> ${TXT_FILE}
echo "RWM$INDEX \"--rwm$INDEX \" i (1,100) | as.numeric(S$INDEX)==0" >> ${TXT_FILE}
echo "ATT$INDEX \"--att$INDEX \" r (1,5) | as.numeric(S$INDEX)==4" >> ${TXT_FILE}
echo "REP$INDEX \"--rep$INDEX \" r (1,5) | as.numeric(S$INDEX)==5" >> ${TXT_FILE}
if [ ${INDEX} == 0 ]; then
echo "NumConnections$INDEX \"--n$INDEX \" i (1,4) | as.numeric(NumStates)>1" >> ${TXT_FILE}
echo "NumConnections$INDEX \"--n$INDEX \" i (1,$NB_TRANS) | as.numeric(NumStates)>1" >> ${TXT_FILE}
else
echo "NumConnections$INDEX \"--n$INDEX \" i (1,4) | as.numeric(NumStates)>${INDEX}" >> ${TXT_FILE}
echo "NumConnections$INDEX \"--n$INDEX \" i (1,$NB_TRANS) | as.numeric(NumStates)>${INDEX}" >> ${TXT_FILE}
fi
}

Expand Down Expand Up @@ -66,7 +67,7 @@ truncate -s 0 $TXT_FILE
echo "NumStates \"--nstates \" i (1,$1)" >> $TXT_FILE
for STATE in $(seq 0 $MAX_NBR_STATES)
do
write_state $STATE
write_state $STATE $2
for CONNECTION in $(seq 0 $MAX_NBR_CONNECTIONS)
do
write_connection $STATE $CONNECTION
Expand Down

0 comments on commit 3219fd0

Please sign in to comment.