Skip to content

Commit

Permalink
feat: add test count for recording datas
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-TW committed Oct 17, 2024
1 parent 179dbff commit 8334a95
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
size = 20

[algorithm]
max_gen = 1000
max_gen = 100
n_neighbors = 10

[test]
count = 100
count = 1
8 changes: 7 additions & 1 deletion src/aeqts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ use crate::types::{Items, Qubits, Solution};

use crate::record::Record;

pub fn aeqts(items: &Items, capacity: f64, max_gen: i32, n_neighbors: i32) -> Solution {
pub fn aeqts(
items: &Items,
capacity: f64,
max_gen: i32,
n_neighbors: i32,
test_count: i32,
) -> Solution {
let mut qubits: Qubits = vec![Default::default(); items.len()];
let mut best_fit: Solution = vec![false; items.len()];
adjust_solution(&items, &mut best_fit, capacity);
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ fn main() {
capacity,
config.algorithm.max_gen,
config.algorithm.n_neighbors,
i,
);
aeqts(
&items,
capacity,
config.algorithm.max_gen,
config.algorithm.n_neighbors,
i,
);
println!("thread[{}] done", i);
});
Expand Down
8 changes: 7 additions & 1 deletion src/qts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ use crate::types::{Items, Qubits, Solution};

use crate::record::Record;

pub fn qts(items: &Items, capacity: f64, max_gen: i32, n_neighbors: i32) -> Solution {
pub fn qts(
items: &Items,
capacity: f64,
max_gen: i32,
n_neighbors: i32,
test_count: i32,
) -> Solution {
let mut qubits: Qubits = vec![Default::default(); items.len()];
let mut best_fit: Solution = vec![false; items.len()];
adjust_solution(&items, &mut best_fit, capacity);
Expand Down

0 comments on commit 8334a95

Please sign in to comment.