prob_transition_t Class Reference

Abstract interface of a class representing a probabilistic transition. More...

#include <prob_transition.hh>

Inheritance diagram for prob_transition_t:

transition_t dve_prob_transition_t

List of all members.

Public Member Functions

size_int_t get_trans_count () const
const transition_tget_transition (const size_int_t i) const
transition_tget_transition (const size_int_t i)
 Returns a pointer to the `i'-th transition of the probabilistic transition.
ulong_int_t get_weight (const size_int_t i) const
 Returns a weight of `i'-th transition.
ulong_int_t get_weight_sum () const
 prob_transition_t (prob_system_t *const system)
 A constructor.
 prob_transition_t ()
 A constructor.
void set_trans_count (const size_int_t size)
 Sets a number of transitions contained in the probabilistic transition.
void set_transition_and_weight (const size_int_t i, transition_t *const p_trans, const ulong_int_t weight)
 Sets `i'-th transition and its weight.

Protected Member Functions

void initialize ()
 A protected initializer.

Protected Attributes

array_t< ulong_int_t > prob_weights
array_t< transition_t * > trans
ulong_int_t weight_sum


Detailed Description

Abstract interface of a class representing a probabilistic transition.

This class represents a probabilistic transition. It is a part of the model of a probabilistic system.

This class is derived from transition_t, although, in fact, it is really different from the ordinary system transition:


Member Function Documentation

size_int_t get_trans_count (  )  const [inline]

Returns a number of transition, which the probabilistic transition consists of

Referenced by prob_system_t::consolidate(), and dve_prob_process_t::write().

const transition_t* get_transition ( const size_int_t  i  )  const [inline]

Returns a pointer to the constant `i'-th transition of the probabilistic transition

ulong_int_t get_weight_sum (  )  const [inline]

Returns a sum of weights of all transitions contained in the probabilistic transition

Note:
Usage of get_weight_sum() is faster than computation of the sum explicitly using repeated call of get_weight(). get_weight_sum() returns precomputed value.

Referenced by dve_prob_explicit_system_t::get_succs().

void set_trans_count ( const size_int_t  size  ) 

Sets a number of transitions contained in the probabilistic transition.

Note:
Existing transitions are not lost by setting new count of transitions. Do not forget to delete all transitions, which you do not plan to use.

References array_t::resize().

Referenced by dve_parser_t::prob_trans_create().

void set_transition_and_weight ( const size_int_t  i,
transition_t *const   p_trans,
const ulong_int_t  weight 
)

Sets `i'-th transition and its weight.

Warning:
If there has alreadty been set `i'-th transition before, this transition is not deleted automatically. Thus, do not forget to call delete(pr_trans.get_transition(i)) before rewritting it by the pointer to another transition.

Referenced by dve_parser_t::prob_trans_create().


The documentation for this class was generated from the following files:

Reference Manual for Library, 2006 developed in ParaDiSe laboratory, Faculty of Informatics, Masaryk University