machetli.successors

Successor generators in the scope of Machetli are classes with a get_successors(state) method defining how successors of a state should be constructed. This module contains the abstract base class SuccessorGenerator and some additional basic functionality. The concrete implementation of a successor generator depends on the instances it should work on. Some concrete successor generators for PDDL and SAS+ files are implemented in the packages machetli.pddl and machetli.sas. More can be added by extending Machetli.

class machetli.successors.ChainingSuccessorGenerator(nested_generators)[source]

Executes multiple evaluators in sequences. This successor generator will first yield all successors of its first nested generator before yielding successors of its second nested generator, and so on. Successors are generated on demand, so an expensive-to-compute generator will only generate successors that are actually evaluated.

Parameters

nested_generators – list of other generators that should be chained.

get_successors(state)[source]

Yield successors of state.

machetli.successors.RNG = <random.Random object>

Random number generator used for shuffling the order of successors in successor generators. Using a fixed seed here makes the order of generated successors reproducible.

class machetli.successors.Successor(state, msg)[source]
class machetli.successors.SuccessorGenerator[source]

Base class for all successor generators.

get_description()[source]
get_successors(state)[source]

Yield successors of state.

machetli.successors.make_single_successor_generator(generators)[source]
Parameters

nested_generators – a single SuccessorGenerator or list of SuccessorGenerators”.

Returns

a single ChainingSuccessorGenerator chaining all involved generators.