Skip to content

Commit

Permalink
Fixed example with new NSGA3 API
Browse files Browse the repository at this point in the history
New version is now 1.0.0 to reflect API breaking change with NSGA3
  • Loading branch information
s-simoncelli committed Sep 1, 2024
1 parent 337ea59 commit 22db289
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 0.7.0
## 1.0.0

- Added new Python API to generate reference points with `DasDarren1998`. The new class
allows getting the weights for the `NSGA3` algorithm and plotting them. See the Python
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "optirustic"
version = "0.6.0"
version = "1.0.0"
authors = ["Stefano Simoncelli <16114781+s-simoncelli@users.noreply.github.com>"]
edition = "2021"
rust-version = "1.80"
Expand Down
4 changes: 2 additions & 2 deletions examples/nsga3_dtlz1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let k: usize = 5;
let number_variables: usize = number_objectives + k - 1;
// Get the built-in problem
let problem = DTLZ1Problem::create(number_variables, number_objectives)?;
let problem = DTLZ1Problem::create(number_variables, number_objectives, false)?;

// Set the number of partitions to create the reference points for the NSGA3 algorithm. This
// uses one layer of 12 uniform gaps
Expand Down Expand Up @@ -64,7 +64,7 @@ fn main() -> Result<(), Box<dyn Error>> {
};

// Initialise the algorithm
let mut algo = NSGA3::new(problem, args).unwrap();
let mut algo = NSGA3::new(problem, args, false).unwrap();

// Run the algorithm
algo.run()?;
Expand Down
4 changes: 2 additions & 2 deletions examples/nsga3_dtlz1_8obj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let number_objectives = 8;
let k: usize = 5;
let number_variables: usize = number_objectives + k - 1; // M + k - 1 with k = 5 (Section Va)
let problem = DTLZ1Problem::create(number_variables, number_objectives)?;
let problem = DTLZ1Problem::create(number_variables, number_objectives, false)?;
// The number of partitions used in the paper when from section 5
let number_of_partitions = NumberOfPartitions::TwoLayers(TwoLayerPartitions {
boundary_layer: 3,
Expand Down Expand Up @@ -54,7 +54,7 @@ fn main() -> Result<(), Box<dyn Error>> {
};

// Initialise the algorithm
let mut algo = NSGA3::new(problem, args).unwrap();
let mut algo = NSGA3::new(problem, args, false).unwrap();

// Run the algorithm
algo.run()?;
Expand Down
2 changes: 1 addition & 1 deletion examples/nsga3_dtlz2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn main() -> Result<(), Box<dyn Error>> {
};

// Initialise the algorithm
let mut algo = NSGA3::new(problem, args).unwrap();
let mut algo = NSGA3::new(problem, args, false).unwrap();

// Run the algorithm
algo.run()?;
Expand Down
2 changes: 1 addition & 1 deletion optirustic-py/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 22db289

Please sign in to comment.