Skip to content

Commit

Permalink
Updates to support version 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dhadka committed Nov 12, 2023
1 parent 63939da commit f243848
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@ Add the following dependency to your `pom.xml`:
<dependency>
<groupId>org.moeaframework</groupId>
<artifactId>pisa-plugin</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</dependency>
```

Or download the JAR from the [Releases](https://github.com/MOEAFramework/PISA-Plugin/releases) into the MOEA Framework's `lib/` folder.

## Supported Versions

The latest versions of the MOEA Framework and the PISA-Plugin are compatible. If using an older version of the
MOEA Framework, use the table below to identify which version of this plugin to use.

MOEA Framework Version | Compatible PISA-Plugin Version
---------------------- | ------------------------------
**`>= 3.8`** | **`1.0.3`**
`3.7` | `1.0.2`
`<= 3.6` | Not available

## Usage

Once this plugin is added, you can reference PISA selectors as you would any other algorithm:
Expand Down
12 changes: 10 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.moeaframework</groupId>
<artifactId>pisa-plugin</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
<packaging>jar</packaging>

<name>PISA Plugin for the MOEA Framework</name>
Expand Down Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>org.moeaframework</groupId>
<artifactId>moeaframework</artifactId>
<version>3.7</version>
<version>3.8</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -49,6 +49,14 @@
<scope>test</scope>
</dependency>
</dependencies>

<repositories>
<repository>
<id>oss.sonatype.org</id>
<name>OSS Sonatype Staging</name>
<url>https://oss.sonatype.org/content/groups/staging</url>
</repository>
</repositories>

<build>
<plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/moeaframework/algorithm/pisa/State.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class State {
/**
* The delay in milliseconds between successive reads of the state file.
*/
private static final long pollRate = Settings.getPISAPollRate();
private static final long pollRate = PISASettings.getPISAPollRate();

/**
* The number of times this class will attempt to write to the state file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,33 @@ public class PISASettingsTest {

@Test
public void testPISAAlgorithms() {
Assert.assertTrue(Settings.getPISAAlgorithms().length >= 0);
Assert.assertTrue(PISASettings.getPISAAlgorithms().length >= 0);
}

@Test
public void testPISAPollRate() {
Assert.assertTrue(Settings.getPISAPollRate() >= 0);
Assert.assertTrue(PISASettings.getPISAPollRate() >= 0);
}

@Test
public void testPISACommand() {
for (String algorithm : Settings.getPISAAlgorithms()) {
Assert.assertNotNull(Settings.getPISACommand(algorithm));
for (String algorithm : PISASettings.getPISAAlgorithms()) {
Assert.assertNotNull(PISASettings.getPISACommand(algorithm));
}
}

@Test
public void testPISAConfiguration() {
for (String algorithm : Settings.getPISAAlgorithms()) {
Assert.assertNotNull(Settings.getPISAConfiguration(algorithm));
for (String algorithm : PISASettings.getPISAAlgorithms()) {
Assert.assertNotNull(PISASettings.getPISAConfiguration(algorithm));
}
}

@Test
public void testPISAParameters() {
for (String algorithm : Settings.getPISAAlgorithms()) {
for (String parameter : Settings.getPISAParameters(algorithm)) {
Assert.assertNotNull(Settings.getPISAParameterDefaultValue(algorithm, parameter));
for (String algorithm : PISASettings.getPISAAlgorithms()) {
for (String parameter : PISASettings.getPISAParameters(algorithm)) {
Assert.assertNotNull(PISASettings.getPISAParameterDefaultValue(algorithm, parameter));
}
}
}
Expand Down

0 comments on commit f243848

Please sign in to comment.