Stat-Tool code example


    Stat_Module_Error error;
    double date;
    int sample1;
    struct {int val; double time;} sample2;


    // creation of Stat-Tool
    // =====================        
    Stat_Module *stat = new  Stat_Module;    
    
    
    // creation of an Entity
    // =====================
    server = new Entity(1,"Server 1");


    // creation of 2 Variables
    // =======================
    service = new Variable(1,"Service Time",
                             ST_Double(),server);

    population = new Variable(2,"Number of customers",
                                ST_Int(),server);



    // creation of the data streams
    // ============================
    stat->create_stream(service,ST_Discrete,1);
    stat->create_stream(population,ST_Continuous,1);


    // analyses to perform
    // ===================
    stat->compute(service, ST_Mean);
    stat->compute(population, ST_Mean);



    // transfer the samples
    // ====================

    for(...) {
         .......
         stat->in(service,sample1);
         stat->in(population,sample2);
         .......
    }


    // result query
    // ============


    result1=(double *)(stat->result(service,ST_Mean,date,error));
    result2=(double *)(stat->result(population,ST_Mean,date,error));

Back to Stat-Tool homepage

Gunther.Siegel@sophia.inria.fr
Wed Jan 3 09:49:40 MET 1996