pub struct SasFile {
pub use_metric: bool,
pub variables: Vec<SasVariable>,
pub mutex_groups: Vec<Vec<Fact>>,
pub initial: Vec<Value>,
pub goal: Vec<Fact>,
pub operators: Vec<SasOperator>,
pub axioms: Vec<SasAxiom>,
}Expand description
An output.sas file, section by section.
Parse it with SasFile::parse or str::parse; its Display
writes it back byte for byte.
Fields§
§use_metric: boolfalse means unit costs: every operator costs 1 whatever its cost field says.
variables: Vec<SasVariable>The variables, indexed by VarId.
mutex_groups: Vec<Vec<Fact>>Groups of facts of which at most one holds in any reachable state.
initial: Vec<Value>The initial value of each variable; for derived variables, the default.
goal: Vec<Fact>The goal, a partial state.
operators: Vec<SasOperator>The operators, indexed by OpId.
axioms: Vec<SasAxiom>The axiom rules.
Implementations§
Source§impl SasFile
impl SasFile
Sourcepub fn parse(text: &str) -> Result<Self, ParseError>
pub fn parse(text: &str) -> Result<Self, ParseError>
Parses the text of an output.sas file. Lines may end in \n or
\r\n; trailing blank lines are allowed.
§Errors
A ParseError with the line of the first problem: a syntax error, a
file version other than SAS_FILE_VERSION, a variable or value out
of range, an axiom that sets a state variable or whose pre value
differs from the variable’s default, or content after the last axiom.
Sourcepub fn operator_cost(&self, op: OpId) -> u32
pub fn operator_cost(&self, op: OpId) -> u32
Sourcepub fn fact_name(&self, fact: Fact) -> &str
pub fn fact_name(&self, fact: Fact) -> &str
The name of a fact, e.g. Atom at(ball1, rooma).
§Panics
If fact is outside the file’s variables or their values.
Sourcepub fn format_plan(&self, plan: &[OpId]) -> String
pub fn format_plan(&self, plan: &[OpId]) -> String
Formats a plan the way Fast Downward writes sas_plan, for use with
plan validators such as VAL.
§Panics
If plan names an operator the file does not have.