tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

mod.rs (1005B)


      1 mod scenarios;
      2 
      3 pub use scenarios::get_scenarios;
      4 
      5 /// Define a testing scenario.
      6 pub struct Scenario {
      7    /// Name of the scenario.
      8    pub name: String,
      9    /// Number of resources.
     10    pub width: usize,
     11    /// Number of sources.
     12    pub depth: usize,
     13    /// Vector of resources, containing a vector of sources, with true indicating
     14    /// whether the resource is present in that source.
     15    pub values: Vec<Vec<bool>>,
     16    /// Vector of solutions, each containing a vector of resources, with the index
     17    /// indicating from which source the resource is chosen.
     18    /// TODO(issue#17): This field is currently unused!
     19    pub solutions: Vec<Vec<usize>>,
     20 }
     21 
     22 impl Scenario {
     23    pub fn new<S: ToString>(
     24        name: S,
     25        width: usize,
     26        depth: usize,
     27        values: Vec<Vec<bool>>,
     28        solutions: Vec<Vec<usize>>,
     29    ) -> Self {
     30        Self {
     31            name: name.to_string(),
     32            width,
     33            depth,
     34            values,
     35            solutions,
     36        }
     37    }
     38 }