Skip to content

Commit

Permalink
update pom and checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
dhixsingh committed Feb 3, 2023
1 parent 69b34d0 commit b9a0661
Show file tree
Hide file tree
Showing 71 changed files with 529 additions and 3,401 deletions.
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

12 changes: 12 additions & 0 deletions checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.0//EN"
"https://checkstyle.org/dtds/suppressions_1_0.dtd">

<suppressions>
<!-- Suppress all checks on auto generated tests -->
<suppress checks="[a-zA-Z0-9]*" files=".*RegressionTest.*\.java"/>
<!-- Suppress some checks on all tests -->
<suppress checks="JavadocType" files=".*[\\/]src[\\/](test|it)[\\/]"/>
</suppressions>
528 changes: 351 additions & 177 deletions checkstyle.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.github.agentsoz.jill.lang.Plan;
import io.github.agentsoz.jill.lang.PlanStep;
import io.github.agentsoz.jill.util.Log;

import java.util.Map;

/**
Expand Down Expand Up @@ -81,6 +80,6 @@ public void setPlanVariables(Map<String, Object> vars) {
public void step() {
Log.debug(getAgent().getName() + " says hello " + neighbour);
}
},};
}, };

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import io.github.agentsoz.jill.lang.Plan;
import io.github.agentsoz.jill.lang.PlanStep;
import io.github.agentsoz.jill.util.Log;

import java.util.Map;

/**
Expand Down Expand Up @@ -71,6 +70,6 @@ public void setPlanVariables(Map<String, Object> vars) {
public void step() {
Log.debug(getAgent().getName() + " says, \"hello, is there any body out there?\"");
}
},};
}, };

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import io.github.agentsoz.jill.lang.Agent;
import io.github.agentsoz.jill.lang.AgentInfo;
import io.github.agentsoz.jill.util.Log;

import java.io.PrintStream;
import java.util.Random;

Expand All @@ -42,15 +41,15 @@ public class Greeter extends Agent {
private static int numNeighbours = 1;
private static final String beliefset = "neighbour";

private static final String[] males =
{"Alex", "Daniel", "John", "Lionel", "Nick", "Oscar", "Paul", "Rod", "Sam", "Tom"};
private static final String[] females =
{"Alice", "Elisa", "Fiona", "Julia", "Kate", "Laura", "Margaret", "Nancy", "Pam", "Rachael"};
private static final String[] middle =
{"A.", "B.", "C.", "D.", "E.", "F.", "G.", "H.", "I.", "J.", "K.", "L.", "M.", "N.", "O.",
"P.", "Q.", "R.", "S.", "T.", "U.", "V.", "W.", "X.", "Y.", "Z."};
private static final String[] males = {
"Alex", "Daniel", "John", "Lionel", "Nick", "Oscar", "Paul", "Rod", "Sam", "Tom"};
private static final String[] females = {
"Alice", "Elisa", "Fiona", "Julia", "Kate", "Laura", "Margaret", "Nancy", "Pam", "Rachael"};
private static final String[] middle = {
"A.", "B.", "C.", "D.", "E.", "F.", "G.", "H.", "I.", "J.", "K.", "L.", "M.", "N.", "O.",
"P.", "Q.", "R.", "S.", "T.", "U.", "V.", "W.", "X.", "Y.", "Z."};
private static final String[] surnames = {"Anderson", "Brown", "Jones", "Martin", "Morton",
"Smith", "Taylor", "White", "Williams", "Wilson",};
"Smith", "Taylor", "White", "Williams", "Wilson", };

/**
* <p>Constructor for Greeter.</p>
Expand All @@ -71,7 +70,7 @@ public void start(PrintStream writer, String[] params) {

// Create a new belief set about neighbours
BeliefSetField[] fields = {new BeliefSetField("name", String.class, true),
new BeliefSetField("gender", String.class, false),};
new BeliefSetField("gender", String.class, false), };

try {
// Attach this belief set to this agent
Expand All @@ -90,7 +89,7 @@ public void start(PrintStream writer, String[] params) {

/**
* Helper function to add beliefs about neighbours.
*
*
* @param rand random number generator to use
* @param count number of beliefs to add
* @throws BeliefBaseException thrown if there is a belief base access error
Expand All @@ -105,7 +104,7 @@ private void registerNeighbours(Random rand, int count) throws BeliefBaseExcepti

/**
* Builds a new name.
*
*
* @param male specifies whether the name should be for a male or female
* @return the constructed name
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/

import io.github.agentsoz.jill.util.Log;

import java.util.ArrayList;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.github.agentsoz.jill.lang.Goal;
import io.github.agentsoz.jill.lang.Plan;
import io.github.agentsoz.jill.lang.PlanStep;

import java.util.Map;

/**
Expand Down Expand Up @@ -101,5 +100,5 @@ public void step() {
subgoal(new Solve("", solve.disc - 1, solve.spare, solve.dest, solve.src));
}
}
},};
}, };
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.github.agentsoz.jill.lang.Agent;
import io.github.agentsoz.jill.lang.AgentInfo;
import io.github.agentsoz.jill.util.Log;

import java.io.PrintStream;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.github.agentsoz.jill.lang.Plan;
import io.github.agentsoz.jill.lang.PlanStep;
import io.github.agentsoz.jill.util.Log;

import java.util.Map;

/**
Expand Down Expand Up @@ -88,5 +87,5 @@ public void step() {
msg.setAgent(nextAgent);
getAgent().send(nextAgent, msg);
}
},};
}, };
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.github.agentsoz.jill.lang.Plan;
import io.github.agentsoz.jill.lang.PlanStep;
import io.github.agentsoz.jill.util.Log;

import java.util.Map;

/**
Expand Down Expand Up @@ -90,5 +89,5 @@ public void step() {
msg.setAgent(nextAgent);
getAgent().send(nextAgent, msg);
}
},};
}, };
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import io.github.agentsoz.jill.lang.Plan;
import io.github.agentsoz.jill.lang.PlanStep;
import io.github.agentsoz.jill.util.Log;

import java.util.Map;

/**
Expand Down Expand Up @@ -106,5 +105,5 @@ public void step() {
msg.setHops(msg.getHops() + 1);
getAgent().send(nextAgent, msg);
}
},};
}, };
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.github.agentsoz.jill.lang.Agent;
import io.github.agentsoz.jill.lang.AgentInfo;
import io.github.agentsoz.jill.util.Log;

import java.io.PrintStream;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.github.agentsoz.jill.lang.Agent;
import io.github.agentsoz.jill.lang.AgentInfo;
import io.github.agentsoz.jill.util.Log;

import java.io.PrintStream;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.github.agentsoz.jill.lang.Agent;
import io.github.agentsoz.jill.lang.AgentInfo;
import io.github.agentsoz.jill.util.Log;

import java.io.PrintStream;

/**
Expand Down Expand Up @@ -64,7 +63,7 @@ public void start(PrintStream writer, String[] params) {
out = writer;

// Create a new belief set about neighbours
BeliefSetField[] fields = {new BeliefSetField("name", String.class, true),};
BeliefSetField[] fields = {new BeliefSetField("name", String.class, true), };

try {
// Attach this belief set to this agent
Expand Down
7 changes: 3 additions & 4 deletions jill/src/main/java/io/github/agentsoz/jill/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@
import io.github.agentsoz.jill.util.AObjectCatalog;
import io.github.agentsoz.jill.util.ArgumentsLoader;
import io.github.agentsoz.jill.util.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.zip.GZIPOutputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* <p>Main class.</p>
Expand Down Expand Up @@ -72,7 +71,7 @@ private Main() {
}

/**
* Program entry
* Program entry.
*
* @param args command line arguments.
*/
Expand Down
5 changes: 2 additions & 3 deletions jill/src/main/java/io/github/agentsoz/jill/Program.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import io.github.agentsoz.jill.core.IntentionSelector;
import io.github.agentsoz.jill.core.ProgramLoader;
import io.github.agentsoz.jill.lang.JillExtension;

import java.util.Scanner;


Expand Down Expand Up @@ -68,7 +67,7 @@ public static void initIntentionSelectionPools(int nagents, int ncores) {

/**
* Starts the intention selection threads that each handle a pool of agents.
*
*
* @param config the global configuration object
*/
static void initIntentionSelectionThreads(Config config) {
Expand Down Expand Up @@ -101,7 +100,7 @@ static void shutdownIntentionSelectionThreads() {

/**
* Loads any configured extensions (see {@link JillExtension}).
*
*
* @param config a valid configuration
* @return true if successfully loaded, false otherwise
*/
Expand Down
12 changes: 8 additions & 4 deletions jill/src/main/java/io/github/agentsoz/jill/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
* #L%
*/

import com.google.gson.Gson;

import ch.qos.logback.classic.Level;

import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -32,7 +30,7 @@
* @author dsingh
* @version $Id: $Id
*/
@SuppressWarnings({"PMD.ImmutableField","PMD.RedundantFieldInitializer"})
@SuppressWarnings({"PMD.ImmutableField", "PMD.RedundantFieldInitializer"})
public class Config {

private String logFile = "Run.log";
Expand Down Expand Up @@ -145,6 +143,9 @@ public String toString() {
return new Gson().toJson(this);
}

/**
* Configuration for Jill extensions.
*/
public class ExtensionData {
private String classname;
private List<String> args = new ArrayList<String>();
Expand All @@ -166,6 +167,9 @@ public void setArgs(List<String> args) {
}
}

/**
* Configuration for agent types.
*/
public class AgentTypeData {
private String classname;
private List<String> args;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class GlobalConstant {
* from the list of applicable instances RANDOM: selects randomly from the list of applicable
* instances LAST: selects the last plan instance from the list of applicable instances (for test
* purposes only)
*
*
* @author dsingh
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.github.agentsoz.jill.core.beliefbase.abs.ABeliefStore;
import io.github.agentsoz.jill.lang.JillExtension;
import io.github.agentsoz.jill.util.AObjectCatalog;

import java.util.HashSet;
import java.util.Set;

Expand Down
Loading

0 comments on commit b9a0661

Please sign in to comment.