JointBrl

Joint multiple inputs and output the sum of them

[ ohymos | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

DESCRIPTION

Class Summary

class JointBrl : public Element
{
public:
JointBrl* NewElement() ;
Boolean Init(char* o_name, int o_num, FILE* fp);
Boolean Init(char* o_name, int o_num, int numinput);
JointBrl(char* o_name, int o_num, int numinput) ;
JointBrl(void) ;
~JointBrl(void) ;
void Set_parameter(FILE* fp);
void Set_port(int n);
void Set_initial_state(FILE* fp) ;
void Set_initial_state(time_t ct) ;
void Save_terminal_state(FILE* fp) ;
void Save_terminal_state(time_t& ct) ;
Boolean Initial_output(void);
time_t Calculate_time_step(void) ;
Boolean Can_you_calculate(void) ;
Boolean Work(void) ;
Boolean Calculate(void);
protected:
}; // JointBrl

Back to the top of JointBrl


DESCRIPTION

An object of class JointBrl has a number of receive ports which receive Data< double> data and send sum of the received data at constant time intervals through a send port.

class JointBrl のオブジェクトは、複数個数の receive port を持ち、そこ から Data< ouble> 型のデータを受けとり、これを折れ線データと解釈して、 一定時間間隔で、それらの線形和を求めて、send port から送出します。

[モデル名] JointBrl

[機能] class JointBrl のオブジェクトは、複数個数の receive port を持 ち、そこから Data< double> 型のデータを受けとり、これを折れ線データと 解釈して、一定時間間隔で、それらの線形和を求めて、send port から送出 します。式で表すと

    a[0]r[0](t+Dt) + a[1]r[1](t+Dt) + ... + a[n-1]r[n-1](t+Dt)
を計算して出力します。ただし、n: receive port の個数、a[0], a[1], ..., a[n-1]: 係数、Dt: 時間間隔、k: 整数です, r[i](t): i番目の受信端 子からの時刻 t の受信値。

[受信端子の仕様] 受信端子の個数は,任意です。

受信端子の個数 n は、

  1. コンストラクタ JointBrl(char* o_name, int o_num, int numinput)
  2. 構造定義ファイルの Init のための追加情報
  3. メンバ関数 Init(char* o_name, int o_num, int numinput)
  4. メンバ関数 Set_ports(int n)

のいずれかを使用して指定します。受信端子が取り扱うデータパックは, Data< double> です。受信端子ごとに,データ記録時刻が違っていても構い ません。受信端子のオブジェクト名は、"rp"、オブジェクト番号は、0, 1, ..., n-1 です。

Init のための追加情報の部分で受信端子の個数を決める場合は、さらに、 パラメタもInit のための追加情報から得るようにします。つまり、 Init のための追加情報には、

    n Dt a[0] a[1] ... a[n-1]
の値を並べます。

[送信端子の仕様] Data&ld double> の折線データを送出する、オブジェ クト名"sp"、オブジェクト番号 0 の送信端子を1個持ちます。

[パラメタの指定] パラメタは、送信端子からデータを出力する時間間隔 Dt (sec), 各受信端子への倍率 a[0], a[1], ... a[n-1] です。受信端子の 個数を Init のための追加情報として与える場合は、ここのパラメタ値も Init のための追加情報として与えるようにします。

[初期状態の指定] 状態量は,current_time だけです。 初期状態を設定する関数として,

    void Set_initial_state(time_t ct);
を用意しています。これは,current_time を ct に設定します。

[解説] 受信端子からは,時間的に変化するデータが入力されるものとしま す。データは折れ線グラフで与えられるものとして,頂点の時刻とその時刻 での値がデータパックにまとめて,受信端子から与えられます。JointBrl で は、個々の受信端子から、mDt 時間毎のデータを取得して、それぞれの値に 係数を乗じて和をとり、送信端子から送出します。

Back to the top of JointBrl


JointBrl* NewElement() ;

Returns a pointer to a new JointBrl

  JointBrl* NewElement()                           
;

Function is currently defined inline.


Back to the top of JointBrl


Boolean Init(char* o_name, int o_num, FILE* fp);

Init function for SCF.

構造定義ファイル用 init 関数。"Init のための追加情報" 部分には、ま ず、受信端子の個数を読みます。その後、Set_parameter に渡して、パラ メタを読み取ります。

     Additional information for Init:
       n Dt a[0] a[1] ... a[n-1]
     n: number of receive ports, Dt: time interval, a[0], ... a[n-1]:
     multipliers
     

  Boolean Init(char* o_name, int o_num, FILE* fp);

Back to the top of JointBrl


Boolean Init(char* o_name, int o_num, int numinput);

in o_name
- object name
in o_num
- object number
in numinput
- number of receive ports

  Boolean Init(char* o_name, int o_num, int numinput);

Back to the top of JointBrl


JointBrl(char* o_name, int o_num, int numinput) ;

Constructor

  JointBrl(char* o_name, int o_num, int numinput)
    ;

Function is currently defined inline.


Back to the top of JointBrl


JointBrl(void) ;

Default constructor

  JointBrl(void)
    ;

Function is currently defined inline.


Back to the top of JointBrl


~JointBrl(void) ;

Destructor

  ~JointBrl(void)
	                                              
;

Function is currently defined inline.


Back to the top of JointBrl


void Set_parameter(FILE* fp);

Read in paramters

     void Set_parameter(FILE* fp) {
      fscanf(fp, "%d", &mDt);
      for (int i = 0; i < mNumRps; i++) fscanf(fp, "%lf", &(mA[i]));
     }
     

  void Set_parameter(FILE* fp);

Back to the top of JointBrl


void Set_port(int n);

Set the number of receive ports

  void Set_port(int n);

Back to the top of JointBrl


void Set_initial_state(FILE* fp) ;

current_time を fscanf(fp, "%ld", ¤t_time) で読み とった値に変更します。読みとった値が非正なら変更しません。

     void Set_initial_state(FILE* fp) {
      time_t tnow; fscanf(fp, "%ld", &tnow);
      if (tnow > 0) current_time = tnow;
     }
     

  void Set_initial_state(FILE* fp)                                                                                        
;

Function is currently defined inline.


Back to the top of JointBrl


void Set_initial_state(time_t ct) ;

current_time を ct に変更します。 ct が非正なら変更しません。

  void Set_initial_state(time_t ct)                                         
;

Function is currently defined inline.


Back to the top of JointBrl


void Save_terminal_state(FILE* fp) ;

current_time を fprintf(fp, "(%ld)", current_time) で書き出します。

  void Save_terminal_state(FILE* fp)                                            
;

Function is currently defined inline.


Back to the top of JointBrl


void Save_terminal_state(time_t& ct) ;

current_time を ct に格納して戻ってきます。

  void Save_terminal_state(time_t& ct)                             
;

Function is currently defined inline.


Back to the top of JointBrl


Boolean Initial_output(void);

初期時刻の入力を加算して,送信端子に書き出します。

  Boolean Initial_output(void);

Back to the top of JointBrl


time_t Calculate_time_step(void) ;

time_step は、mDt に固定です。

  time_t Calculate_time_step(void)                
;

Function is currently defined inline.


Back to the top of JointBrl


Boolean Can_you_calculate(void) ;

すべての受信端子で、Necessary_time_from, Necessary_time_to で定義さ れる時間の間のデータが取得できれば計算可能と判断します。

  Boolean Can_you_calculate(void)                                 
;

Function is currently defined inline.


Back to the top of JointBrl


Boolean Work(void) ;

計算時間間隔を決めてから calculate を実行する Work0 を採用していま す。

  Boolean Work(void)                    
;

Function is currently defined inline.


Back to the top of JointBrl


Boolean Calculate(void);

     a[0]r[0](t+Dt) + a[1]r[1](t+Dt) + ... + a[n-1]r[n-1](t+Dt)
     
を送信端子に送ります。

  Boolean Calculate(void);

Back to the top of JointBrl


All Members

public:
JointBrl* NewElement() ;
Boolean Init(char* o_name, int o_num, FILE* fp);
Boolean Init(char* o_name, int o_num, int numinput);
void Set_parameter(FILE* fp);
void Set_port(int n);
void Set_initial_state(FILE* fp) ;
void Set_initial_state(time_t ct) ;
void Save_terminal_state(FILE* fp) ;
void Save_terminal_state(time_t& ct) ;
Boolean Initial_output(void);
time_t Calculate_time_step(void) ;
Boolean Can_you_calculate(void) ;
Boolean Work(void) ;
Boolean Calculate(void);
protected:

Back to the top of JointBrl


Ancestors

Inheritance chain for JointBrl:

Back to the top of JointBrl


Descendants

Class is not inherited by any others.

Back to the top of JointBrl


Generated from source by the Cocoon utilities on Sun Sep 17 20:23:55 2000 .

Report problems to jkotula@stratasys.com