diff --git a/Cargo.toml b/Cargo.toml index 1e0596e..d4df157 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,8 @@ lto = true [features] default = [] verbose = [] -no_python = [] +no_python = [] # Removes the python bindings +fast = [] # Remove some under optimisations that try to find other routes [lib] name = "xiv_craft_solver" diff --git a/python3.py b/example.py similarity index 100% rename from python3.py rename to example.py diff --git a/src/io.rs b/src/io.rs index 0f308ec..af0c153 100644 --- a/src/io.rs +++ b/src/io.rs @@ -157,7 +157,7 @@ impl SolverResult{ impl Parameters{ pub fn from_args(args:& Args) -> Self{ Self{ - depth: if args.desperate{10}else{8}, + depth: if args.desperate{11}else{8}, threads: args.threads, verbose: args.verbose, desperate: args.desperate, diff --git a/src/lib.rs b/src/lib.rs index 39ade3a..fdd70c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,6 @@ pub fn solve_craft<'a>(recipe: Recipe, stats: Stats, params: Parameters) -> Opti #[cfg(feature = "verbose")] if params.verbose>0{ - println!("Solving...\n"); println!("[P1] Starting phase 1..."); } @@ -48,9 +47,6 @@ pub fn solve_craft<'a>(recipe: Recipe, stats: Stats, params: Parameters) -> Opti if let Some(mut _route) = solver::generate_routes_phase2(route){ let mut shared = _phase2_routes.lock().unwrap(); shared.append(&mut _route); - // for inner_route in _route{ - // shared.push(inner_route.clone()); - // } }; }); } diff --git a/src/solver.rs b/src/solver.rs index 6326127..c43243f 100644 --- a/src/solver.rs +++ b/src/solver.rs @@ -171,11 +171,13 @@ pub fn generate_routes_phase2<'a>(craft: Craft<'a>) -> Option>> { craft.run_action(action.unwrap()); if action.unwrap() == &ACTIONS.byregot_blessing { if let Some(top_route) = &mut top_route { + #[cfg(not(feature="fast"))] if top_route.quality>craft.recipe.quality{ top_routes.push(craft.clone()); // Me memory } if top_route.quality < craft.quality { - // TODO: Return several routes, doing so will come at a big performance cost + #[cfg(feature="fast")] + top_routes.push(craft.clone()); *top_route = craft; } } else {