【发布时间】:2016-07-03 13:22:30
【问题描述】:
免责声明:我没有编写此代码,我只是想让它工作。
我正在尝试从here 获取代码工作。 设置是安装了 Erlang 的 Ubuntu 14.04 64 位机器。
动作顺序如下: 我正在做的事情如下:
- 克隆代码
-
cd到带有代码的文件夹和终端中的erl make:all([load]).polis:create().polis:start().-
benchmarker:start(slidingwindow50).
我得到的错误是:
4> benchmarker:start(slidingwindow50).
true Dimensions:4,
Plasticity:none Dimensions:4, Plasticity:none Dimensions:4,
Plasticity:none Dimensions:4, Plasticity:none Dimensions:4,
Plasticity:none Dimensions:4, Plasticity:none Dimensions:4,
Plasticity:none Dimensions:4, Plasticity:none Dimensions:4,
Plasticity:none Dimensions:4, Plasticity:none
Specie_Id:6.858114617542796e-10 Morphology:forex_trader
******** Population monitor started with parameters:{state,benchmark,test,[], [],undefined,undefined,
undefined,[],0,0,0,0,0, undefined,undefined, undefined,undefined,
undefined,undefined,0.5, 10,10,mathema,inf,10000, inf,<0.274.0>,false}
Initial Tot Evaluations:0
Started Started Started Started Started Started Started
5> =ERROR REPORT==== 16-Mar-2016::14:11:34 === Error in process
<0.287.0> with exit value:
{badarg,[{ets,last,['EURUSD15'],[]},{fx,init_state,5,[{file,"fx.erl"},{line,375}]},{fx,sim,3,[{file,"fx.erl"},{line,284}]}]}
=ERROR REPORT==== 16-Mar-2016::14:11:34 === Error in process <0.288.0> with exit value:
{badarg,[{ets,last,['EURUSD15'],[]},{fx,init_state,5,[{file,"fx.erl"},{line,375}]},{fx,sim,3,[{file,"fx.erl"},{line,284}]}]}
查看fx.erl 的代码表明问题可能源于ets 部分和.txt 文件未从磁盘读取到内存中的表中。
更新:我一直在尝试调查fx 的功能。到目前为止,我有这样的结果:
fx:sim(anything) 输出“已启动”并使外壳无响应;
fx:init(). 结果
初始化外汇货币 表:[元数据,'EURUSD15','EURUSD30','EURUSD60'] 外汇元数据 & 货币表已初始化并写入文件。 好的
fx:loop().输出很多
新记录插入到表中:'EURUSD15'
最后一行是
新的 FOREX_DB 更新开始于:{2009,6,16,7,30,0,15}
然后
=错误报告==== 22-Mar-2016::16:41:26 === 进程 出错,退出值: {badarg,[{fx,insert_ForexRaw,2,[{file,"fx.erl"},{line,767}]},{fx,updater,1,[{file,"fx.erl"},{line ,698}]},{fx,heartbeat,3,[{file,"fx.erl"},{line,692}]}]}
在fx:init(). 之后运行ets:i(). 显示没有名为EURUSD15 的表。
为什么会这样,我该如何解决?
附: 如果找到可行的解决方案,我打算要求将更改与原始代码合并(基本上,我会尝试推送请求)。
【问题讨论】:
-
来自
ets:last的badarg错误表明表'EURUSD15'不存在。 -
正确。所以,我想了解它为什么不存在。
标签: erlang erlang-shell ets