Skip to content

Commit

Permalink
Enabled CentralisedRuntimeServices#createAgent to work with debug GUI
Browse files Browse the repository at this point in the history
When a new agent is created while debug mode is enabled, it needs to be
set up to work in synchronous mode, perform FINE logging and have a
verbose level of 2. For some reason, setting the verbose level enables
the GUI to automatcally detect the new agent.
  • Loading branch information
cartisan committed Jul 12, 2018
1 parent aa0f560 commit 0dfff5a
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -58,6 +58,16 @@ public String createAgent(String agName, String agSource, String agClass, List<S
agArch.createArchs(ap.getAgArchClasses(), ap.agClass.getClassName(), ap.getBBClass(), agSource, stts, masRunner);
agArch.setEnvInfraTier(masRunner.getEnvironmentInfraTier());
agArch.setControlInfraTier(masRunner.getControllerInfraTier());

// if debug mode is active, set up new agent to be synchronous and visible for ExecutionControlGUI
if(BaseCentralisedMAS.debug) {
stts.setVerbose(2);
stts.setSync(true);
agArch.getLogger().setLevel(Level.FINE);
agArch.getTS().getLogger().setLevel(Level.FINE);
agArch.getTS().getAg().getLogger().setLevel(Level.FINE);
}

masRunner.addAg(agArch);
}

Expand Down

0 comments on commit 0dfff5a

Please sign in to comment.