/******************************************************* * * DESCRIPTION: QBG parallel junction class * * AUTHOR: Mariana C. D'Abreu * * EMAIL: mdabreu@dc.uba.ar * ********************************************************/ #ifndef _QBG_PARALLEL_JUNC_H #define _QBG_PARALLEL_JUNC_H #include "atomic.h" #include "message.h" #define QBG_PARALLEL_JUNC_CLASS_NAME "QBGParallelJunction" class QBGParallelJunction : public Atomic { public: QBGParallelJunction( const string &name = QBG_PARALLEL_JUNC_CLASS_NAME ); ~QBGParallelJunction(); virtual string className() const { return QBG_PARALLEL_JUNC_CLASS_NAME;} protected: Model &initFunction(); Model &externalFunction( const ExternalMessage & ); Model &internalFunction( const InternalMessage & ); Model &outputFunction( const InternalMessage & ); bool updateFlow( const string &, const RealValue & ); void resetFlows(); void getPortValueAndSign( const string &, RealValue &, int & ); void setPortValue( const string &, const RealValue & ); void getPortInfo( const string &, string &, int &, string & ); private: const Port &e1p; // Port de entrada de effort positivo const Port &e1n; // Port de entrada de effort negativo const Port &f2p, &f3p, &f4p, &f5p, &f6p; // Ports de entrada de flow positivos const Port &f2n, &f3n, &f4n, &f5n, &f6n; // Ports de entrada de flow negativos Port &f1p; // Port de salida de flow positivo Port &f1n; // Port de salida de flow negativo Port &e2p, &e3p, &e4p, &e5p, &e6p; // Ports de salida de effort positivos Port &e2n, &e3n, &e4n, &e5n, &e6n; // Ports de salida de effort negativos RealValue *flows; // Valor del flow de cada port RealValue effort; RealValue flowP; RealValue flowN; bool init; }; #endif