in reply to objects becoming unblessed?

jand has the solution to the problem you have (the blessing problem, not the Markov problem). If you want to continue with your data structure, you should modify what your transitions table looks like. You can stringify the reference and use that as the key (though there's better ways of doing it). However, instead of pointing to the values directly, you'll need to point to an array reference where the first value there is the values and the second is the Emitter object.

Now, better would be to turn your problem around. From what I understand of Markov chaining, you need to calculate some value which is the next value in the chain. Then, based on that value, you want to return some emitter object. Why not just use the Markov values as the keys and the objects as the values in your transitions hash?

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re: objects becoming unblessed?
by omnibus (Scribe) on Mar 17, 2003 at 19:03 UTC
    yes, jand is correct. To clear up the confusion, there are two methods: transitions() (with an s) is the getter/setter for the transitions table, and transition() (no s) picks an Emitter from the transitions table and returns it.

    I'm going to go back and just store these things in an array, rather than in a hash.

    As for the Markov model - I'm using this code to generate a sequence of states + emissions. So the algorithm is

    emit a value->transition to the next state-> if current state isn't the end state then repeat.
    Of course, the next step is to write the code that goes back and tries to figure out what the hidden states were based solely on the emissions.