The Source class


class Main_Source : public Source<Client> {    
protected:
    Door *in, *out;
    Counter  *counter;
    Cashier  *cashier;
    Random   *nb_articles_distribution;
public:
    Main_Source((Random *intergeneration, Door *in_, Door *out_, Counter *counter_,
                    Cashier *cashier_) : Source<Client>(intergeneration){
        in=in_;
        out=out_;
        counter=counter_;
        cashier=cashier_;
        nb_articles_distribution=new Uniform(3,20, new MLCG);
    };
protected:
    bool stop_condition() {
        return((total_population()>=1000) || (get_time()>=20000));
    };
    virtual void customer_init(Client *customer)  {
          customer->entrance_door = in;
          customer->exit_door = out;
          customer->visited_counter = counter;
          customer->used_cashier = cashier;
          customer->nb_articles = (int)floor((*nb_articles_distribution)());    
    };
};


Gunther.Siegel@sophia.inria.fr
Sun Nov 26 12:52:37 MET 1995