-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: convert into a workspace (#3)
- Loading branch information
1 parent
cd4436e
commit e84f599
Showing
12 changed files
with
158 additions
and
741 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
[package] | ||
name = "fluido-saturate" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
anyhow = "1.0.79" | ||
clap = { version = "4.5.0", features = ["derive"] } | ||
egg = "0.9.5" | ||
[workspace] | ||
resolver = "2" | ||
members = ["mixer-generator", "fluido"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "fluido" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
mixer-generator = { path = "../mixer-generator/" } | ||
anyhow = "1.0.79" | ||
clap = { version = "4.5.0", features = ["derive"] } |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
mod cmd; | ||
|
||
use clap::Parser; | ||
use cmd::Args; | ||
use mixer_generator::concentration::Concentration; | ||
|
||
fn main() -> anyhow::Result<()> { | ||
let args = Args::try_parse()?; | ||
|
||
let time_limit = args.time_limit; | ||
let target_concentration = args.target_concentration; | ||
let input_space = args | ||
.input_space | ||
.iter() | ||
.map(|input_concentration| Concentration::from_f64(*input_concentration)) | ||
.collect(); | ||
println!( | ||
"Starting to equality saturation, this will take ~{} seconds to finish.", | ||
time_limit | ||
); | ||
|
||
let generated_mixer_sequence = | ||
mixer_generator::saturate(target_concentration, time_limit, input_space)?; | ||
|
||
let cost = generated_mixer_sequence.cost; | ||
let expr = generated_mixer_sequence.best_expr; | ||
|
||
println!("best expr: {expr}"); | ||
println!("cost: {cost}"); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "mixer-generator" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
anyhow = "1.0.79" | ||
clap = { version = "4.5.0", features = ["derive"] } | ||
egg = "0.9.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use clap::Parser; | ||
|
||
/// Searching a mixer configuration from given input space and target concantration. | ||
#[derive(Parser, Debug)] | ||
#[command(version, about, long_about = None)] | ||
pub struct Args { | ||
/// Target concentration | ||
#[arg(short, long)] | ||
pub target_concentration: f64, | ||
|
||
/// Input space, intial concentrations at hand. | ||
/// example_input: [`0.2 0.3 0.4`] | ||
#[arg(short, long)] | ||
pub input_space: Vec<f64>, | ||
|
||
/// Time limit in seconds. | ||
#[arg(short, long)] | ||
pub time_limit: u64, | ||
} |
File renamed without changes.
Oops, something went wrong.