本文整理汇总了Java中jason.runtime.Settings.addOption方法的典型用法代码示例。如果您正苦于以下问题:Java Settings.addOption方法的具体用法?Java Settings.addOption怎么用?Java Settings.addOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jason.runtime.Settings
的用法示例。
在下文中一共展示了Settings.addOption方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAsSetts
import jason.runtime.Settings; //导入方法依赖的package包/类
public Settings getAsSetts(boolean debug, boolean forceSync) {
Settings stts = new Settings();
if (options != null) {
Map<String,Object> opt = new HashMap<String, Object>();
//String s = ""; String v = "";
for (String key: options.keySet()) {
opt.put(key, options.get(key));
//s += v + key + "=" + options.get(key);
//v = ",";
}
if (!opt.isEmpty()) {
stts.setOptions(opt);
//if (s.length() > 0) {
// stts.setOptions("["+s+"]");
}
}
if (debug) {
stts.setVerbose(2);
}
if (forceSync || debug) {
stts.setSync(true);
}
stts.addOption(Settings.PROJECT_PARAMETER, this); // place of copy of this object anyway
return stts;
}
示例2: main
import jason.runtime.Settings; //导入方法依赖的package包/类
public static void main(String[] args) throws JasonException {
ClimaArchitecture agent = new ClimaArchitecture();
//configure network
Settings stts = new Settings();
stts.addOption("host", "localhost");
stts.addOption("port", "12300");
//configure credentials
stts.addOption("username", "china1");
stts.addOption("password", "1");
agent.initAg(null, null, stts);
}
示例3: getAsSetts
import jason.runtime.Settings; //导入方法依赖的package包/类
public Settings getAsSetts(boolean debug, boolean forceSync) {
Settings stts = new Settings();
if (options != null) {
Map<String,Object> opt = new HashMap<String, Object>();
//String s = ""; String v = "";
for (String key: options.keySet()) {
opt.put(key, options.get(key));
//s += v + key + "=" + options.get(key);
//v = ",";
}
if (!opt.isEmpty()) {
stts.setOptions(opt);
//if (s.length() > 0) {
// stts.setOptions("["+s+"]");
}
}
if (debug) {
stts.setVerbose(2);
}
if (forceSync || debug) {
stts.setSync(true);
}
stts.addOption(Settings.PROJECT_PARAMETER, this); // place of copy of this object anyway
return stts;
}