实验的特定输入 return 解析器错误
Specific inputs of experiment return parser error
#!/bin/bash
for tracelength in 50 100 150 200 250 300 350 400 450 500 ; do
step=0.2
short=0
long=1
for i in {1..4}; do
ratio=0
for j in {1..4}; do
declare -a listofresults
echo "$tracelength $short $long $ratio" >> results.csv
python3 main.py "$tracelength" "$short" "$long" "$ratio">file.smt2
chmod 775 file.smt2
declare total=0
declare m=0
for repeat in {1..10}; do
executiontime=$(timeout 500 gtime -f "%U" /Users/ouafaelachhab/Desktop/SemanticLocality/optimathsat-1.6.2-macos-64-bit/bin/optimathsat < file.smt2 2>&1 >/dev/null)
echo "$executiontime"
total=$(echo "scale=2; ($total) + ($executiontime)" | bc) #echo $(bc <<< "scale=2; $total/100")
echo "$total"
let "m=m+1"
echo "m=$m"
done
echo $(bc <<< "scale=2; ($total)/10") >> results.csv
ratio=$(echo "scale=10; ($ratio) + ($step)" | bc) #float points arithmetics are different
done
short=$(echo "scale=10; ($short) + ($step)" | bc)
long=$(echo "scale=10; ($long) - ($step)" | bc)
done
done
我基本上只是 运行ning 一个实验,我 运行 一个包含不同输入的文件。该代码适用于某些值,而对于某些值,它只给了我:
(standard_in) 1: parse error
在我的结果文件中,这是我的输出:
50 0 1 0
21.82
50 0 1 .2
27.08
50 0 1 .4
40.89
50 0 1 .6
我正在进行的实验 运行ning 总是在相同的输入值(输出文件中打印的最后一个)停止,然后从那里开始都是 解析器错误 !为什么要这样做?我该如何解决?我在这里尝试了针对类似问题(与 bc 相关)找到的多种解决方案,但 none 有效。
我怀疑它与以下行有关:
executiontime=$(timeout 500 gtime -f "%U" /Users/ouafaelachhab/Desktop/SemanticLocality/optimathsat-1.6.2-macos-64-bit/bin/optimathsat &1 >/dev/null)
当我使用
更改您的代码时
执行时间="ISSUE"
我将其作为输出(注意 I S S U E 是如何逐行打印的)
m=3
ISSUE
(standard_in) 1: parse error
(standard_in) 1: illegal character: I
(standard_in) 1: illegal character: S
(standard_in) 1: illegal character: S
(standard_in) 1: illegal character: U
#!/bin/bash
for tracelength in 50 100 150 200 250 300 350 400 450 500 ; do
step=0.2
short=0
long=1
for i in {1..4}; do
ratio=0
for j in {1..4}; do
declare -a listofresults
echo "$tracelength $short $long $ratio" >> results.csv
python3 main.py "$tracelength" "$short" "$long" "$ratio">file.smt2
chmod 775 file.smt2
declare total=0
declare m=0
for repeat in {1..10}; do
executiontime=$(timeout 500 gtime -f "%U" /Users/ouafaelachhab/Desktop/SemanticLocality/optimathsat-1.6.2-macos-64-bit/bin/optimathsat < file.smt2 2>&1 >/dev/null)
echo "$executiontime"
total=$(echo "scale=2; ($total) + ($executiontime)" | bc) #echo $(bc <<< "scale=2; $total/100")
echo "$total"
let "m=m+1"
echo "m=$m"
done
echo $(bc <<< "scale=2; ($total)/10") >> results.csv
ratio=$(echo "scale=10; ($ratio) + ($step)" | bc) #float points arithmetics are different
done
short=$(echo "scale=10; ($short) + ($step)" | bc)
long=$(echo "scale=10; ($long) - ($step)" | bc)
done
done
我基本上只是 运行ning 一个实验,我 运行 一个包含不同输入的文件。该代码适用于某些值,而对于某些值,它只给了我:
(standard_in) 1: parse error
在我的结果文件中,这是我的输出:
50 0 1 0
21.82
50 0 1 .2
27.08
50 0 1 .4
40.89
50 0 1 .6
我正在进行的实验 运行ning 总是在相同的输入值(输出文件中打印的最后一个)停止,然后从那里开始都是 解析器错误 !为什么要这样做?我该如何解决?我在这里尝试了针对类似问题(与 bc 相关)找到的多种解决方案,但 none 有效。
我怀疑它与以下行有关:
executiontime=$(timeout 500 gtime -f "%U" /Users/ouafaelachhab/Desktop/SemanticLocality/optimathsat-1.6.2-macos-64-bit/bin/optimathsat &1 >/dev/null)
当我使用
更改您的代码时执行时间="ISSUE"
我将其作为输出(注意 I S S U E 是如何逐行打印的)
m=3
ISSUE
(standard_in) 1: parse error (standard_in) 1: illegal character: I (standard_in) 1: illegal character: S (standard_in) 1: illegal character: S (standard_in) 1: illegal character: U