Class markov::SimpleModel
Simplified Model representation.
This base class has a predifined transition type (SimpleTransition
) and implementations for calculate_cost_difference
and apply_transition
. These implementations make no assumptions about the model and they are, as a result, typically inefficient (i.e., calculating the whole calculate_cost in lieu of only the changed parts).
The base class is provided as a means for rapid prototyping because it requires less interfaces to be implemented.
Inherited Members
Methods
get_identifier()
Returns the identifier string of the model type (e.g., "ising").
Declaration
std::string markov::SimpleModel<State>::get_identifier() const override=0
get_version()
Returns the version of the input format this implementation expects.
Declaration
std::string markov::SimpleModel<State>::get_version() const override=0
calculate_cost_difference()
Default calculate_cost_difference implementation.
This computes the expected difference of a transition by invoking calculate_cost twice. This is almost always inefficient (at the very least, one could cache the value for the starting point). SimpleModel
therefore only serves the purpose of rapidly writing a base implementation to check against.
Note
This relies on using SimpleTransition with the model - such that both the start and end state of the transition can easily be accessed.
Declaration
Cost_T markov::SimpleModel<State>::calculate_cost_difference(const State_T&state, const Transition_T&transition) const override
apply_transition()
Default apply_transition implementation.
Since SimpleTransition has Transition as a base, we can just use its apply method (which, in turn, will set state to to()
).
Declaration
virtual void markov::SimpleModel<State>::apply_transition(const Transition_T&transition, State_T&state) const override