Commit 3c25f3f4 authored by Bharat Garhewal's avatar Bharat Garhewal
Browse files

Refactor HADS init

parent 5691e4e8
Pipeline #60918 passed with stages
in 3 minutes and 27 seconds
......@@ -31,6 +31,7 @@ the repository.
pub struct HadsTree<'a, T> {
oq_oracle: Rc<RefCell<OQOracle<'a, T>>>,
lookahead: usize,
location: String,
seed: u64,
rev_input_map: FnvHashMap<InputSymbol, String>,
rev_output_map: FnvHashMap<OutputSymbol, String>,
......@@ -48,25 +49,34 @@ where
rev_input_map: FnvHashMap<InputSymbol, String>,
rev_output_map: FnvHashMap<OutputSymbol, String>,
) -> Self {
Self {
oq_oracle: output_oracle,
Self::with_location(
output_oracle,
(),
"./hybrid-ads/build/main".to_string(),
lookahead,
seed: random_seed,
random_seed,
rev_input_map,
rev_output_map,
}
)
}
fn with_location(
_output_oracle: Rc<RefCell<OQOracle<'a, T>>>,
output_oracle: Rc<RefCell<OQOracle<'a, T>>>,
_config: (),
_location: String,
_lookahead: usize,
_random_seed: u64,
_rev_input_map: FnvHashMap<InputSymbol, String>,
_rev_output_map: FnvHashMap<OutputSymbol, String>,
location: String,
lookahead: usize,
random_seed: u64,
rev_input_map: FnvHashMap<InputSymbol, String>,
rev_output_map: FnvHashMap<OutputSymbol, String>,
) -> Self {
unimplemented!()
Self {
oq_oracle: output_oracle,
lookahead,
location,
seed: random_seed,
rev_input_map,
rev_output_map,
}
}
}
......@@ -207,7 +217,8 @@ where
T: ObservationTree + Sync,
{
fn hads_process(&self, lookahead_custom: Option<usize>) -> Child {
let h_ads_path = std::fs::canonicalize("./hybrid-ads/build/main").unwrap();
// let h_ads_path = std::fs::canonicalize("./hybrid-ads/build/main").unwrap();
let h_ads_path = std::fs::canonicalize(self.location.clone()).unwrap();
let random_infix_length = lookahead_custom.unwrap_or(self.lookahead);
Command::new(h_ads_path)
.args(&[
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment