2024-11-20 00:20:40 +03:00
|
|
|
use std::io;
|
|
|
|
|
|
|
|
pub mod bee;
|
|
|
|
pub mod food;
|
|
|
|
|
|
|
|
pub struct Input {
|
|
|
|
pub decision_variable_count: usize,
|
|
|
|
pub food_source_number: u128,
|
|
|
|
pub food_source_try_limit: u128,
|
|
|
|
pub upper_bound: f64,
|
|
|
|
pub lower_bound: f64,
|
|
|
|
pub iteration: usize,
|
2024-11-20 00:20:40 +03:00
|
|
|
pub run: usize,
|
2024-11-20 00:20:40 +03:00
|
|
|
}
|
|
|
|
impl Input {
|
|
|
|
pub fn get() -> Self {
|
|
|
|
println!("Decision Variable Count");
|
|
|
|
let decision_variable_count = Self::get_input().parse().unwrap();
|
|
|
|
|
|
|
|
println!("Food Source Number");
|
|
|
|
let food_source_number = Self::get_input().parse().unwrap();
|
|
|
|
|
|
|
|
println!("Food Source Try Limit");
|
|
|
|
let food_source_try_limit = Self::get_input().parse().unwrap();
|
|
|
|
|
|
|
|
println!("Upper Bound");
|
|
|
|
let upper_bound = Self::get_input().parse().unwrap();
|
|
|
|
|
|
|
|
println!("Lower Bound");
|
|
|
|
let lower_bound = Self::get_input().parse().unwrap();
|
|
|
|
|
|
|
|
println!("Iteration");
|
|
|
|
let iteration = Self::get_input().parse().unwrap();
|
|
|
|
|
2024-11-20 00:20:40 +03:00
|
|
|
println!("Run");
|
|
|
|
let run = Self::get_input().parse().unwrap();
|
2024-11-20 00:20:40 +03:00
|
|
|
Input {
|
|
|
|
decision_variable_count,
|
|
|
|
food_source_number,
|
|
|
|
food_source_try_limit,
|
|
|
|
upper_bound,
|
|
|
|
lower_bound,
|
|
|
|
iteration,
|
2024-11-20 00:20:40 +03:00
|
|
|
run,
|
2024-11-20 00:20:40 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
fn get_input() -> String {
|
|
|
|
let mut input = String::new();
|
|
|
|
io::stdin().read_line(&mut input).unwrap();
|
|
|
|
input.trim().to_string()
|
|
|
|
}
|
|
|
|
}
|