当前位置: 首页>>代码示例>>Java>>正文


Java Settings.addOption方法代码示例

本文整理汇总了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;
}
 
开发者ID:nickrfer,项目名称:code-sentinel,代码行数:28,代码来源:AgentParameters.java

示例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);
}
 
开发者ID:jason-lang,项目名称:apps,代码行数:15,代码来源:ClimaArchitecture.java

示例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;
}
 
开发者ID:jason-lang,项目名称:jason,代码行数:28,代码来源:AgentParameters.java


注:本文中的jason.runtime.Settings.addOption方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。