本文整理汇总了Java中jade.wrapper.ControllerException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ControllerException.printStackTrace方法的具体用法?Java ControllerException.printStackTrace怎么用?Java ControllerException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jade.wrapper.ControllerException
的用法示例。
在下文中一共展示了ControllerException.printStackTrace方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getComboBoxModelContainer
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
private DefaultComboBoxModel<String> getComboBoxModelContainer() {
if (comboBoxModelContainer==null) {
comboBoxModelContainer = new DefaultComboBoxModel<>();
if (Application.getJadePlatform().isMainContainerRunning(false)==true) {
// --- Get the known container ------------
try {
comboBoxModelContainer.addElement(Application.getJadePlatform().getMainContainer().getContainerName());
for (AgentContainer container : Application.getJadePlatform().getAgentContainerList()) {
comboBoxModelContainer.addElement(container.getContainerName());
}
} catch (ControllerException e) {
e.printStackTrace();
}
} else {
// --- Just take the Main-Container -------
comboBoxModelContainer.addElement(jade.core.AgentContainer.MAIN_CONTAINER_NAME);
}
}
return comboBoxModelContainer;
}
示例2: startContainerWithArguments
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
/**
* Method which creates a new container, with the given command line arguments
*
* @param _args
* - arguments, as specified in the command line. The <code>-container</code> option is not mandatory
*/
@Deprecated
public void startContainerWithArguments(String _args)
{
String args = _args;
if(_args.indexOf("-container") == -1)
args = (new String("-container ")) + _args;
AgentContainer container = runJadeWithArguments(args);
try
{
containerList.put(container.getContainerName(), container);
} catch(ControllerException e)
{
e.printStackTrace();
}
}
示例3: doMove
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
/**
* new do move behavior
*/
@Override
public void doMove(Location dest)
{
try
{
if(!dest.getName().equals(this.getContainerController().getContainerName()))
{
log.info("moving to [" + dest.getName() + "]");
super.doMove(dest);
}
} catch(ControllerException e)
{
e.printStackTrace();
}
}
示例4: getContainer
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
/**
* Returns the {@link AgentContainer} given by it's name.
*
* @param containerNameSearch the container name search
* @return the agent container
*/
public AgentContainer getContainer(String containerNameSearch ) {
// --- If JADE is not already running -------------------
if (this.isMainContainerRunning()==false) {
return null;
}
// --- Searching for the 'Main-Container'? -------------
if (containerNameSearch.equals(this.mainContainerName)==true) {
return this.jadeMainContainer;
}
// --- Get the right container -------------------------
for (int i=0; i < this.getAgentContainerList().size(); i++) {
AgentContainer agentContainer = this.getAgentContainerList().get(i);
try {
String acName = agentContainer.getContainerName();
if (acName!=null && acName.equalsIgnoreCase(containerNameSearch)==true) {
return agentContainer;
}
} catch (ControllerException ex) {
ex.printStackTrace();
}
}
return null;
}
示例5: initAgent
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
public static void initAgent(PlatformController container, Object[] args, String path, String id){
final AgentController agentController;
try {
agentController = container.createNewAgent(id, path, args);
agentController.start();
} catch (ControllerException e ) {
e.printStackTrace();
}
}
示例6: killSoundSource
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
public void killSoundSource(String id){
AgentController ac;
try {
ac = getCc().getAgent(soundSources.get(id).getLocalName());
ac.kill();
} catch (ControllerException e) {
e.printStackTrace();
}
}
示例7: removeModule
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
public void removeModule(String modulename)
{
messageQueues.remove(modulename);
try {
agentController = agentContainer.getAgent(modulename);
agentController.kill();
}
catch (ControllerException e) {
e.printStackTrace();
}
}
示例8: startPlatformWithArguments
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
/**
* Starts a new platform, with the given command line arguments
*
* @param args
* - arguments, as specified in the command line
*/
@Deprecated
public void startPlatformWithArguments(String args)
{
mainContainer = runJadeWithArguments(args);
try
{
containerList.put(mainContainer.getContainerName(), mainContainer);
} catch(ControllerException e)
{
e.printStackTrace();
}
}
示例9: getMainContainerName
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
/**
* @return the name of the main container, if any.
*/
@Override
public String getMainContainerName()
{
if(mainContainer != null)
try
{
return getMainContainer().getContainerName();
} catch(ControllerException e)
{
e.printStackTrace();
}
return null;
}
示例10: doMove
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
@Override
public void doMove(Location destination) {
try {
if (!destination.getName().equals(
this.getContainerController().getContainerName())) {
getLog().info("moving to [" + destination.toString() + "]");
removeVisualization();
}
} catch (ControllerException e) {
e.printStackTrace();
}
super.doMove(destination);
}
示例11: afterMove
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
/**
* after move, send message to all children to request them to follow
*/
@Override
protected void afterMove()
{
super.afterMove();
log.info("arrived on new container");
// Send a message to all is subnetwork to spark off the migration
// 1° create the message
final ACLMessage msg = HierarchyOntology.setupMessage(Vocabulary.FOLLOWME);
try
{
msg.setContent(this.getContainerController().getContainerName());
} catch(ControllerException e)
{
e.printStackTrace();
}
// 2° add all the receiver's AID
for(String child : this.getHierRelation().getChildren())
{
msg.addReceiver(new AID(child, AID.ISLOCALNAME));
}
// 3° send it
this.send(msg);
}
示例12: setup
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
protected void setup() {
gui = new AgentView(this);
try {
appendToScreen("Here I am! So this is my birth place: "
+ getContainerController().getContainerName()
+ ". Hmmm! Nice!");
} catch (ControllerException e) {
e.printStackTrace();
}
addBehaviour(new LoaderBehaviour());
}
示例13: setup
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
protected void setup() {
gui = new AgentView(this);
try {
appendToScreen("Here I am! So this is my birth place: "
+ getContainerController().getContainerName()
+ ". Hmmm! Nice!");
} catch (ControllerException e) {
e.printStackTrace();
}
addBehaviour(new Behaviour(this) {
private static final long serialVersionUID = 2961482086480776913L;
@Override
public void action() {
block();
}
@Override
public boolean done() {
return false;
}
});
}
示例14: afterMove
import jade.wrapper.ControllerException; //导入方法依赖的package包/类
protected void afterMove() {
gui.setVisible(true);
try {
appendToScreen("I\'m happy to be in this new location: "
+ getContainerController().getContainerName() + "!");
} catch (ControllerException e) {
e.printStackTrace();
}
gui.addListeners();
}