我想弄清楚如何运行需要传递不同类型参数的java程序。这里是作者程序的说明:
跑 :
$ cd wmart/work/
$ java -jar WMartSimulator <seed> <maxDays> <daysForward> <membersFile> [<parameters>]
Java 可能需要足够的选项,具体取决于您的环境。例如:
$ java -d64 -Xms1G -Xmx30G -Djava.library.path=/usr/ilog/cplex/bin/x86-64_debian4.0_4.1:/usr/local/lib -jar WMartSimulator.jar 0 30 7 member/type1.csv demandfile=demand/trial.csv\;demand/trial.csv:logdir=result/trial-type1
我试图通过将他的特定指令映射到我自己的来执行该程序。这是我所做的:
在 eclipse 的程序参数中,我放了:
0 30 7 bin/work/member/type1.csv "demandfile=bin/work/demand/trial.csv"
和虚拟机参数:
-Djava.library.path="C:\Program Files (x86)\LPSolve IDE\LpSolveIDE.exe"
设置它们后,我得到了以下关于我的错误的一般描述:
java.lang.NullPointerException
at edu.iw.mace.environment.Settings.<init>(Settings.java:69)
at edu.iw.mace.environment.Market.<init>(Market.java:94)
at edu.iw.mace.environment.Market.<init>(Market.java:79)
at org.wmart.core.WBoard.<init>(WBoard.java:67)
at org.wmart.core.WAuctioneer.initialize(WAuctioneer.java:52)
at org.wmart.core.WMart.setupAuctioneers(WMart.java:1339)
at org.wmart.core.WMart.<init>(WMart.java:112)
at org.wmart.core.WMartSimulator.<init>(WMartSimulator.java:83)
at org.wmart.core.WMartSimulator.main(WMartSimulator.java:47)
Settings.java:69 对应的块代码为:
public Settings() throws FactoryException, MaceException {
try {
config = new PropertiesConfiguration(PROPERTIES_FILE);
} catch (ConfigurationException e) {
log.error(e.fillInStackTrace());
}
config.setAutoSave(true);// line 69
initProperties();
}
我想知道我是否正确遵循了作者网站中的规定: https ://github.com/ikfj/wmart/#run
你能告诉我的配置有什么问题吗?而且,如果你能给我处理这些具体问题的具体文档。