Bugfix(Core) - Clean of some bindings and errors, adds a compiler feature for faster build
This commit is contained in:
parent
daa9408ba5
commit
5c862e2b93
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
// }
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,11 +171,13 @@ pub fn generate_routes_phase2<'a>(craft: Craft<'a>) -> Option<Vec<Craft<'a>>> {
|
|||
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 {
|
||||
|
|
|
|||
Reference in New Issue