Created by Scott Robert Ladd at Coyote Gulch Productions.
#include <simple_fsm.h>

| InputSize | Number of input states | |
| OutputSize | Number of output states |
| libevocosm::simple_fsm< InSize, OutSize >::simple_fsm | ( | size_t | a_size | ) | [inline] |
Creates a new finite state machine with a given number of states.
| a_size | - Initial number of states in this machine |
References libevocosm::globals::g_random, libevocosm::simple_fsm< InSize, OutSize >::m_current_state, libevocosm::simple_fsm< InSize, OutSize >::m_init_state, libevocosm::simple_fsm< InSize, OutSize >::tranout_t::m_new_state, libevocosm::simple_fsm< InSize, OutSize >::tranout_t::m_output, and libevocosm::simple_fsm< InSize, OutSize >::m_state_table.
| libevocosm::simple_fsm< InSize, OutSize >::simple_fsm | ( | const simple_fsm< InSize, OutSize > & | a_parent1, | |
| const simple_fsm< InSize, OutSize > & | a_parent2 | |||
| ) | [inline] |
Creates a new simple_fsm by combining the states of two parent machines.
References libevocosm::globals::g_random, libevocosm::simple_fsm< InSize, OutSize >::m_current_state, libevocosm::simple_fsm< InSize, OutSize >::m_init_state, libevocosm::simple_fsm< InSize, OutSize >::tranout_t::m_new_state, libevocosm::simple_fsm< InSize, OutSize >::tranout_t::m_output, libevocosm::simple_fsm< InSize, OutSize >::m_size, and libevocosm::simple_fsm< InSize, OutSize >::m_state_table.
| libevocosm::simple_fsm< InSize, OutSize >::simple_fsm | ( | const simple_fsm< InSize, OutSize > & | a_source | ) | [inline] |
Creates a new simple_fsm identical to an existing one.
| a_source | - Object to be copied |
| libevocosm::simple_fsm< InSize, OutSize >::~simple_fsm | ( | ) | [inline, virtual] |
Does nothing in the base class; exists to allow destruction of derived class objects through base class pointers.
| simple_fsm< InSize, OutSize > & libevocosm::simple_fsm< InSize, OutSize >::operator= | ( | const simple_fsm< InSize, OutSize > & | a_source | ) | [inline] |
Copies the state of an existing simple_fsm.
| a_source | - Object to be copied |
References libevocosm::simple_fsm< InSize, OutSize >::m_current_state, libevocosm::simple_fsm< InSize, OutSize >::m_init_state, and libevocosm::simple_fsm< InSize, OutSize >::m_size.
| void libevocosm::simple_fsm< InSize, OutSize >::mutate | ( | double | a_rate | ) | [inline] |
Mutates a finite state machine object. The four mutations supported are:
| a_rate | - Chance that any given state will mutate |
References libevocosm::globals::g_random, libevocosm::simple_fsm< InSize, OutSize >::g_selector, libevocosm::fsm_tools::mutation_selector::get_index(), libevocosm::simple_fsm< InSize, OutSize >::m_current_state, libevocosm::simple_fsm< InSize, OutSize >::m_init_state, libevocosm::simple_fsm< InSize, OutSize >::tranout_t::m_new_state, libevocosm::simple_fsm< InSize, OutSize >::tranout_t::m_output, libevocosm::simple_fsm< InSize, OutSize >::m_state_table, libevocosm::fsm_tools::MUTATE_INIT_STATE, libevocosm::fsm_tools::MUTATE_OUTPUT_SYMBOL, libevocosm::fsm_tools::MUTATE_REPLACE_STATE, libevocosm::fsm_tools::MUTATE_SWAP_STATES, and libevocosm::fsm_tools::MUTATE_TRANSITION.
| void libevocosm::simple_fsm< InSize, OutSize >::set_mutation_weight | ( | mutation_id | a_type, | |
| double | a_weight | |||
| ) | [inline, static] |
Sets the weight value associated with a specific mutation; this changes the relative chance of this mutation happening.
| a_type | - ID of the weight to be changed | |
| a_weight | - New weight to be assigned |
References libevocosm::simple_fsm< InSize, OutSize >::g_selector, and libevocosm::fsm_tools::mutation_selector::set_weight().
| size_t libevocosm::simple_fsm< InSize, OutSize >::transition | ( | size_t | a_input | ) | [inline] |
Based on an input symbol, this function changes the state of an simple_fsm and returns an output symbol.
| a_input | - An input value |
References libevocosm::simple_fsm< InSize, OutSize >::m_current_state, libevocosm::simple_fsm< InSize, OutSize >::tranout_t::m_new_state, libevocosm::simple_fsm< InSize, OutSize >::tranout_t::m_output, and libevocosm::simple_fsm< InSize, OutSize >::m_state_table.
| void libevocosm::simple_fsm< InSize, OutSize >::reset | ( | ) | [inline] |
Prepares the FSM to start running from its initial state.
References libevocosm::simple_fsm< InSize, OutSize >::m_current_state, and libevocosm::simple_fsm< InSize, OutSize >::m_init_state.
| size_t libevocosm::simple_fsm< InSize, OutSize >::size | ( | ) | const [inline] |
Returns the size of a simple_fsm.
| const simple_fsm< InSize, OutSize >::tranout_t & libevocosm::simple_fsm< InSize, OutSize >::get_transition | ( | size_t | a_state, | |
| size_t | a_input | |||
| ) | const [inline] |
Get a transition from the internal state table.
| a_state | - Target state | |
| a_input | - State information to return |
References libevocosm::simple_fsm< InSize, OutSize >::m_state_table.
| size_t libevocosm::simple_fsm< InSize, OutSize >::num_input_states | ( | ) | const [inline] |
Returns the number of input states
| size_t libevocosm::simple_fsm< InSize, OutSize >::num_output_states | ( | ) | const [inline] |
Returns the number of output states
| size_t libevocosm::simple_fsm< InSize, OutSize >::init_state | ( | ) | const [inline] |
Returns the initial (start up) state.
References libevocosm::simple_fsm< InSize, OutSize >::m_init_state.
| size_t libevocosm::simple_fsm< InSize, OutSize >::current_state | ( | ) | const [inline] |
Returns the current (active) state.
References libevocosm::simple_fsm< InSize, OutSize >::m_current_state.
© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.