本文整理汇总了Java中jason.runtime.Settings.getUserParameter方法的典型用法代码示例。如果您正苦于以下问题:Java Settings.getUserParameter方法的具体用法?Java Settings.getUserParameter怎么用?Java Settings.getUserParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jason.runtime.Settings
的用法示例。
在下文中一共展示了Settings.getUserParameter方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createArchs
import jason.runtime.Settings; //导入方法依赖的package包/类
/**
* Creates the user agent architecture, default architecture is
* jason.architecture.AgArch. The arch will create the agent that creates
* the TS.
*/
public void createArchs(List<String> agArchClasses, String agClass, ClassParameters bbPars, String asSrc, Settings stts, RunCentralisedMAS masRunner) throws JasonException {
try {
this.masRunner = masRunner;
Agent.create(this, agClass, bbPars, asSrc, stts);
insertAgArch(this);
createCustomArchs(agArchClasses);
// mind inspector arch
if (stts.getUserParameter(Settings.MIND_INSPECTOR) != null) {
insertAgArch( (AgArch)Class.forName( Config.get().getMindInspectorArchClassName()).newInstance() );
getFirstAgArch().init();
}
setLogger();
} catch (Exception e) {
running = false;
throw new JasonException("as2j: error creating the agent class! - "+e.getMessage(), e);
}
}
示例2: initAg
import jason.runtime.Settings; //导入方法依赖的package包/类
@Override
public void initAg(String agClass, ClassParameters bbPars, String asSrc, Settings stts) throws JasonException {
super.initAg(agClass, bbPars, asSrc, stts);
logger = Logger.getLogger(ACArchitecture.class.getName()+"."+getAgName());
String username = stts.getUserParameter("username");
if (username.startsWith("\"")) username = username.substring(1,username.length()-1);
String password = stts.getUserParameter("password");
if (password.startsWith("\"")) password = password.substring(1,password.length()-1);
proxy = new ACProxy( this,
stts.getUserParameter("host"),
Integer.parseInt(stts.getUserParameter("port")),
username,
password);
proxy.start();
}
示例3: initAg
import jason.runtime.Settings; //导入方法依赖的package包/类
@Override
public void initAg(String agClass, ClassParameters bbPars, String asSrc, Settings stts) throws JasonException {
super.initAg(agClass, bbPars, asSrc, stts);
logger = Logger.getLogger(ACArchitecture.class.getName()+"."+getAgName());
String username = stts.getUserParameter("username");
if (username.startsWith("\"")) username = username.substring(1,username.length()-1);
//if (username.startsWith("#nid")) username = ""+(getAgId(getAgName())+1);
username = username.replaceAll("#nid", ""+(getAgId(getAgName())+1));
String password = stts.getUserParameter("password");
if (password.startsWith("\"")) password = password.substring(1,password.length()-1);
waitSleepThread = new WaitSleep();
waitSleepThread.start();
proxy = new ACProxy( this,
stts.getUserParameter("host"),
Integer.parseInt(stts.getUserParameter("port")),
username,
password);
new Thread(proxy,"AgentProxy"+username).start();
}
示例4: initAg
import jason.runtime.Settings; //导入方法依赖的package包/类
@Override
public void initAg(String agClass, ClassParameters bbPars, String asSrc, Settings stts) throws JasonException {
super.initAg(agClass, bbPars, asSrc, stts);
logger = Logger.getLogger(ACArchitecture.class.getName()+"."+getAgName());
String username = stts.getUserParameter("username");
if (username.startsWith("\"")) username = username.substring(1,username.length()-1);
//if (username.startsWith("#nid")) username = ""+(getAgId(getAgName())+1);
username = username.replaceAll("#nid", ""+(getAgId(getAgName())+1));
String password = stts.getUserParameter("password");
if (password.startsWith("\"")) password = password.substring(1,password.length()-1);
waitSleepThread = new WaitSleep();
waitSleepThread.start();
proxy = new ACProxy( this,
stts.getUserParameter("host"),
Integer.parseInt(stts.getUserParameter("port")),
username,
password);
new Thread(proxy,"AgentProxy"+username).start();
}
示例5: initAg
import jason.runtime.Settings; //导入方法依赖的package包/类
public void initAg(String agClass, String asSrc, Settings stts) throws JasonException {
super.initAg(agClass, asSrc, stts);
logger = Logger.getLogger(ClimaArchitecture.class.getName()+"."+getAgName());
String username = stts.getUserParameter("username");
if (username.startsWith("\"")) username = username.substring(1,username.length()-1);
String password = stts.getUserParameter("password");
if (password.startsWith("\"")) password = password.substring(1,password.length()-1);
boolean gui = true;
if ("no".equals(stts.getUserParameter("gui"))) {
gui = false;
}
clima = new ClimaProxy(this,
stts.getUserParameter("host"),
Integer.parseInt(stts.getUserParameter("port")),
username,
password,
gui);
//launch proxy agent
try {
// try to discover the ag id
int id = Integer.parseInt(getAgName().substring(5));
clima.setAgId(id-1);
} catch (Exception e) {}
clima.start();
}
示例6: initAg
import jason.runtime.Settings; //导入方法依赖的package包/类
@Override
public void initAg(String agClass, ClassParameters bbPars, String asSrc, Settings stts) throws JasonException {
super.initAg(agClass, bbPars, asSrc, stts);
logger = Logger.getLogger(ACArchitecture.class.getName()+"."+getAgName());
String username = stts.getUserParameter("username");
if (username.startsWith("\"")) username = username.substring(1,username.length()-1);
String password = stts.getUserParameter("password");
if (password.startsWith("\"")) password = password.substring(1,password.length()-1);
waitSleepThread = new WaitSleep();
waitSleepThread.start();
proxy = new ACProxy( this,
stts.getUserParameter("host"),
Integer.parseInt(stts.getUserParameter("port")),
username,
password);
new Thread(proxy,"AgentProxy"+username).start();
}
示例7: initAg
import jason.runtime.Settings; //导入方法依赖的package包/类
@Override
public void initAg(String agClass, ClassParameters bbPars, String asSrc, Settings stts) throws JasonException {
super.initAg(agClass, bbPars, asSrc, stts);
model = new LocalWorldModel(10,10, WorldModel.agsByTeam, getTS().getAg().getBB()); // just to have a default model
gui = "yes".equals(stts.getUserParameter("gui"));
if ("yes".equals(stts.getUserParameter("write_status"))) {
writeStatusThread = WriteStatusThread.create(this);
}
WriteStatusThread.registerAgent(getAgName(), this);
// create the viewer for contest simulator
massimBackDir = stts.getUserParameter("ac_sim_back_dir");
if (massimBackDir != null && massimBackDir.startsWith("\""))
massimBackDir = massimBackDir.substring(1,massimBackDir.length()-1);
logger = Logger.getLogger(CowboyArch.class.getName() + ".CA-" + getAgName());
setCheckCommunicationLink(false);
}
示例8: createArchs
import jason.runtime.Settings; //导入方法依赖的package包/类
/**
* Creates the user agent architecture, default architecture is
* jason.architecture.AgArch. The arch will create the agent that creates
* the TS.
*/
public void createArchs(List<String> agArchClasses, String agClass, ClassParameters bbPars, String asSrc, Settings stts, BaseCentralisedMAS masRunner) throws JasonException {
try {
this.masRunner = masRunner;
Agent.create(this, agClass, bbPars, asSrc, stts);
insertAgArch(this);
createCustomArchs(agArchClasses);
// mind inspector arch
if (stts.getUserParameter(Settings.MIND_INSPECTOR) != null) {
insertAgArch( (AgArch)Class.forName( Config.get().getMindInspectorArchClassName()).newInstance() );
getFirstAgArch().init();
}
setLogger();
} catch (Exception e) {
running = false;
throw new JasonException("as2j: error creating the agent class! - "+e.getMessage(), e);
}
}
示例9: initAg
import jason.runtime.Settings; //导入方法依赖的package包/类
@Override
public void initAg(String agClass, ClassParameters bbPars, String asSrc, Settings stts) throws JasonException {
super.initAg(agClass, bbPars, asSrc, stts);
//model = new LocalWorldModel(150,150, WorldModel.agsByTeam, getTS().getAg().getBB()); // just to have a default model
gui = "yes".equals(stts.getUserParameter("gui"));
if (getMyId() == 0)
gui = true;
boolean writeStatus = "yes".equals(stts.getUserParameter("write_status"));
boolean dumpAgsMind = "yes".equals(stts.getUserParameter("dump_ags_mind"));
if (writeStatus || dumpAgsMind)
writeStatusThread = WriteStatusThread.create(this, writeStatus, dumpAgsMind);
teamId = stts.getUserParameter("teamid");
if (teamId == null)
logger.info("*** No 'teamid' parameter!!!!");
else if (teamId.startsWith(""))
teamId = teamId.substring(1, teamId.length()-1);
WriteStatusThread.registerAgent(getAgName(), this);
// create the viewer for contest simulator
massimBackDir = stts.getUserParameter("ac_sim_back_dir");
if (massimBackDir != null && massimBackDir.startsWith("\""))
massimBackDir = massimBackDir.substring(1,massimBackDir.length()-1);
logger = Logger.getLogger(CowboyArch.class.getName() + ".CA-" + getAgName());
setCheckCommunicationLink(false);
initialBeliefs();
}
示例10: initAg
import jason.runtime.Settings; //导入方法依赖的package包/类
@Override
public void initAg(String agClass, ClassParameters bbPars, String asSrc, Settings stts) throws JasonException {
super.initAg(agClass, bbPars, asSrc, stts);
//model = new LocalWorldModel(150,150, WorldModel.agsByTeam, getTS().getAg().getBB()); // just to have a default model
gui = "yes".equals(stts.getUserParameter("gui"));
if (getMyId() == 0)
gui = true;
boolean writeStatus = "yes".equals(stts.getUserParameter("write_status"));
boolean dumpAgsMind = "yes".equals(stts.getUserParameter("dump_ags_mind"));
if (writeStatus || dumpAgsMind)
writeStatusThread = WriteStatusThread.create(this, writeStatus, dumpAgsMind);
teamId = stts.getUserParameter("teamid");
if (teamId == null)
logger.info("*** No 'teamid' parameter!!!!");
else if (teamId.startsWith(""))
teamId = teamId.substring(1, teamId.length()-1);
WriteStatusThread.registerAgent(getAgName(), this);
// create the viewer for contest simulator
massimBackDir = stts.getUserParameter("ac_sim_back_dir");
if (massimBackDir != null && massimBackDir.startsWith("\""))
massimBackDir = massimBackDir.substring(1,massimBackDir.length()-1);
logger = Logger.getLogger(CowboyArch.class.getName() + ".CA-" + getAgName());
setCheckCommunicationLink(false);
initialBeliefs();
}
示例11: initAg
import jason.runtime.Settings; //导入方法依赖的package包/类
public void initAg(String agClass, String asSrc, Settings stts) throws JasonException {
super.initAg(agClass, asSrc, stts);
logger = Logger.getLogger(ClimaArchitecture.class.getName()+"."+getAgName());
clima = new ClimaProxy(this,
stts.getUserParameter("host"),
Integer.parseInt(stts.getUserParameter("port")),
stts.getUserParameter("username"),
stts.getUserParameter("password"));
//launch proxy agent
clima.start();
}