示例#1
0
state_t find_stop_state(const graph_t<NodeCount> & graph, const state_t & start_state, size_t length, sigma_t sigma) {
    state_t state(start_state);
    
    for(size_t i = 0; i < length; ++i)
        state = graph.next(state, sigma);
    
    return state;
}
示例#2
0
state_t generate_observation_sequence(const graph_t<NodeCount> & graph, size_t length, ObservationIt it) {
    /* Randomize start position */
    
    sigma_t sigma(random_sigma<NodeCount>());
    
    //std::cerr << "sigma: " << sigma << std::endl;
    
    state_t state(rand() % NodeCount, GRAPH_0);
    
    //std::cerr << "state chosen: " << state.v << std::endl;
    
    for(size_t i = 0; i < length; ++i) {
        state = graph.next(state, sigma);
        
        //std::cerr << "state: " << state << std::endl;
        
        it++ = state.e;
    }
    
    return state;
}