Synopsis

struct              NtdSimulator;
struct              NtdSimulatorClass;
gfloat              ntd_simulator_get_deviation         (NtdSimulator *simulator);
gulong              ntd_simulator_get_seed              (NtdSimulator *simulator);
NtdProtocol *       ntd_simulator_new                   (void);
void                ntd_simulator_set_deviation         (NtdSimulator *simulator,
                                                         gfloat deviation);
void                ntd_simulator_set_seed              (NtdSimulator *simulator,
                                                         gulong seed);

Object Hierarchy

  GObject
   +----NtdProtocol
         +----NtdSimulator

Properties

  "deviation"                gfloat                : Read / Write
  "seed"                     gulong                : Read / Write

Description

Details

struct NtdSimulator

struct NtdSimulator;

struct NtdSimulatorClass

struct NtdSimulatorClass {
    NtdProtocolClass       parent_class;

    NtdDevice*             null_device;
};

ntd_simulator_get_deviation ()

gfloat              ntd_simulator_get_deviation         (NtdSimulator *simulator);

Gets the deviation used while generating the random numbers. This modifies the random generation to let the numbers appear more or less similar to the previous values. A value of #1 (the default) makes new numbers totally independent from their previous value while a value of #0 generates series of equal numbers.

Note: Not yet used.

simulator :

an NtdSimulator object.

Returns :

the requested deviation or -1 on errors.

ntd_simulator_get_seed ()

gulong              ntd_simulator_get_seed              (NtdSimulator *simulator);

Gets the seed used in the internal random number generation.

simulator :

an NtdSimulator object.

Returns :

the requested seed or 0 on errors.

ntd_simulator_new ()

NtdProtocol *       ntd_simulator_new                   (void);

Creates a new NtdSimulator object.

Returns :

the newly created object.

ntd_simulator_set_deviation ()

void                ntd_simulator_set_deviation         (NtdSimulator *simulator,
                                                         gfloat deviation);

Sets the deviation to use in the internal random number generation. See the ntd_simulator_get_deviation() to a more detailed description.

Note: Not yet used.

simulator :

an NtdSimulator object.

deviation :

the new deviation to use.

ntd_simulator_set_seed ()

void                ntd_simulator_set_seed              (NtdSimulator *simulator,
                                                         gulong seed);

Sets the seed to use in the internal random number generation. If you do not specify this seed, the GRand internal structure will not be initialized by g_rand_set_seed(): really I don't know which are the effects.

simulator :

an NtdSimulator object.

seed :

the new seed to use.

Property Details

The "deviation" property

  "deviation"                gfloat                : Read / Write

Deviation of the values from the previous ones.

Allowed values: [0,1]

Default value: 1


The "seed" property

  "seed"                     gulong                : Read / Write

Value to reinitialize the random number generator.