Commit fc9fe81c by Alan White

desktop results and code update for running tests

parent 0ff6e32d
Pipeline #2261452 skipped
......@@ -2,7 +2,7 @@
MAS twtest {
infrastructure: Centralised
environment: truckworld.env.Cargoworld("paperWorld2.properties", "nrisk3/ndebil025.properties", "1", "maint-quality")
environment: truckworld.env.Cargoworld("paperWorld1.properties", "nrisk3/ndebil075.properties", "10", "maint-quality")
/* Agent args;
knownAgents - if set, defines a fixed list of agents from whom we receive capability notices. If
......
......@@ -3,20 +3,8 @@
MAS twtest {
//note; other infrastructures not tested or supported
infrastructure: Centralised
environment: truckworld.env.Cargoworld("paperWorld2.properties", "nrisk3/ndebil0.properties", "1","maint-speed")
environment: truckworld.env.Cargoworld("paperWorld1.properties", "nrisk3/ndebil0.properties", "5","maint-speed")
/* Agent args;
knownAgents - if set, defines a fixed list of agents from whom we receive capability notices. If
not set, then we just accept advertisements from everyone
doMaintain - if true, attempts maintenance / pre-emptive plan repair tasks
doMaintain - if true, attempts replanning at progressive levels of abstraction when a task or delegated task fails
mpMaxCost - planning cost maximum limit for precond maint tasks
domain - domain name used to get primitive capability/goal task factory object
capabilities - names of primitive capabilities (for use in factory)
advertised - names of capabilities - both composite and primitive - which are to be advertised
to other agent for potential use as delegated tasks.
taskKnowledge - goal tasks known, and which we are interested in externalCapabilities for.
*/
agents:
//STRATEGIC
......
......@@ -16,15 +16,15 @@ public class Analytics {
private final HashMap<AnalyticsOperations, Long> totalTime;
private final HashMap<AnalyticsOperations, Integer> totalCalls;
private final static Analytics _instance = new Analytics();
private final static Analytics _instance = new Analytics();
private final JTable details;
private final JFrame aui;
private final String[] detailsCols =
new String[]{"action", "calls", "average (ms)", "total (ms)"};
private Analytics() {
totalTime = new HashMap<>();
totalCalls = new HashMap<>();
final JFrame aui = new JFrame();
aui = new JFrame();
aui.setSize(500, 300);
aui.setResizable(true);
......
......@@ -21,17 +21,14 @@
//
//----------------------------------------------------------------------------
package common;
import jason.JasonException;
import jason.infra.centralised.CentralisedAgArch;
import jason.infra.centralised.RunCentralisedMAS;
import jason.mas2j.AgentParameters;
import jason.runtime.MASConsoleGUI;
import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;
import agent.type.arch.SuccessRecorderArch;
import jason.JasonException;
import jason.infra.centralised.CentralisedAgArch;
import jason.infra.centralised.RunCentralisedMAS;
import jason.mas2j.AgentParameters;
/**
* Extends centralized case to use multiagentarch as the default instead of centralizedarch; this
......@@ -91,39 +88,4 @@ public class RunCampBDIMAS extends RunCentralisedMAS {
logger.log(Level.SEVERE, "getAg returning\n" + rt + "\n" + rt.getClass().getCanonicalName());
return rt;
}
/**
* Removes system.exit, might be a bit wonky
* @see jason.infra.centralised.RunCentralisedMAS#finish()
*/
@Override
public void finish() {
try {
System.out.flush();
System.err.flush();
if (MASConsoleGUI.hasConsole()) { // should close first! (case where console is in pause)
MASConsoleGUI.get().close();
}
if (getControllerInfraTier() != null) {
getControllerInfraTier().stop();
}
if (getEnvironmentInfraTier() != null) {
getEnvironmentInfraTier().stop();
}
stopAgs();
runner = null;
// remove the .stop___MAS file (note that GUI console.close(), above, creates this file)
File stop = new File(stopMASFileName);
if (stop.exists()) {
stop.delete();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
package truckworld;
import java.io.IOException;
import java.security.Permission;
import jason.JasonException;
public class RunMultiTimesScript {
public static void main(final String[] args) throws JasonException, IOException {
SecurityManager original = System.getSecurityManager();
System.setSecurityManager(new NoExitSecurityManager());
for (int i=0; i<4; i++) {
try {
cleanup();
common.RunCampBDIMAS.main(args);
System.out.println("Done Run " + i);
} catch (ExitException e) {
if (e.getStatus() != 0) {
throw new RuntimeException(e);
}
e.printStackTrace();
}
}
System.setSecurityManager(original);
System.exit(0);
}
private static void cleanup() throws IOException {
new ProcessBuilder("clean.bat").start();
}
private static class NoExitSecurityManager extends SecurityManager {
@Override
public void checkPermission(Permission perm) {
}
@Override
public void checkPermission(Permission perm, Object context) {
}
@Override
public void checkExit(int status) {
super.checkExit(status);
throw new ExitException(status);
}
}
protected static class ExitException extends SecurityException {
private static final long serialVersionUID = 9170704544383671704L;
public final int status;
public ExitException(int status) {
super("Exit; " + status);
this.status = status;
}
public int getStatus() {
return status;
}
}
}
package truckworld;
import java.io.IOException;
import jason.JasonException;
public class RunScript {
public static void main(final String[] args) throws JasonException, IOException {
final String[] runMe = new String[] { "maint-paper-speed9.mas2j", "maint-paper-speed10.mas2j" };
for (String run : runMe) {
cleanup();
common.RunCampBDIMAS.main(new String[] { run });
System.out.println("Ran " + run);
}
System.exit(0);
}
private static void cleanup() throws IOException {
new ProcessBuilder("clean.bat").start();
}
}
......@@ -3687,11 +3687,6 @@ public class Cargoworld extends Environment {
public void kill() throws Exception {
if(ui.isVisible()) {
ui.setVisible(false);
try {
ui.dispose();
} catch (Exception e) {
e.printStackTrace();
}
}
logger.severe("INVOKING SHUTDOWN");
......
......@@ -463,9 +463,8 @@ public class WorldUi extends JFrame implements WindowListener, ActionListener {
big.drawString(goalStats, 5, 15);
Vector<String> vS = new Vector<String>();
Object[] vo = env.getVehicles().values().toArray();
for (Object ago : vo) {
Vehicle ag = (Vehicle) ago;
for (String agKey : env.getVehicles().keySet()) {
Vehicle ag = (Vehicle) env.getVehicles().get(agKey);
if (ag.getHealth().equals(HealthState.damaged)) {
vS.add(ag.getId() + "(D)");
} else if (ag.getHealth().equals(HealthState.mortal)) {
......
......@@ -79,7 +79,7 @@ public class EnvStepper extends ParamUser implements Stepper {
dzAddedLastTime = new Vector<>();
stormMode = getBooleanParam(propFile, Param.stormMode);
probRainController = new ProbabalisticRainController(env, propFile);
new EnvStepperControl(this);
//new EnvStepperControl(this);
}
private Map<String, Integer> initalizeDzProhibitMap() {
......
fail, dependencyCancel, confirmContractWithObligant, obligantAccept, succeed, obligationMaintained, obligantRefuse, do, updatedContract, dependencyMaintained
32, 174, 1366, 1366, 1202, 42, 3, 1234, 5032, 41
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment