data and send sum of received data at constant
time intervals through a send port.
class JointBl のオブジェクトは、複数個数の receive port を持ち、そこ
から Data 型のデータを受けとり、これを折れ線データと解釈して、
一定時間間隔で、それらの線形和を求めて、send port から送出します。
[モデル名] JointBl
[機能] class JointBl のオブジェクトは、複数個数の receive port を持
ち、そこから Data 型のデータを受けとり、これを折れ線データと
解釈して、一定時間間隔で、それらの線形和を求めて、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 の受信値。
[受信端子の仕様] 受信端子の個数は,任意です。
受信端子の個数は、構造定義ファイルでは、Init のための付加情報の部分
や Init(char* o_name, int o_num, int numinput)
で指定します。または、メンバ関数 Set_ports(int n) で指定します。受信
端子が取り扱うデータパックは,Data です。受信端子ごとに,デー
タ記録時刻が違っていても構いません。受信端子のオブジェクト名は、"rp"、
オブジェクト番号は、0, 1, ..., n-1 です。
[送信端子の仕様] Data&ld double> の折線データを送出する、オブジェ
クト名"sp"、オブジェクト番号 0 の送信端子を1個持ちます。
[パラメタの指定] パラメタは、送信端子からデータを出力する時間間隔
Dt (sec), 各受信端子への倍率 a[0], a[1], ... a[n-1] です。
[初期状態の指定] 状態量は,current_time だけです。
初期状態を設定する関数として,
void Set_initial_state(time_t ct);
を用意しています。これは,current_time を ct に設定します。
[解説] 受信端子からは,時間的に変化するデータが入力されるものとしま
す。データは折れ線グラフで与えられるものとして,頂点の時刻とその時刻
での値がデータパックにまとめて,受信端子から与えられます。JointBl で
は、個々の受信端子から、mDt 時間毎のデータを取得して、それぞれの値に
係数を乗じて和をとり、送信端子から送出します。
Back to the top of JointBl
JointBl* NewElement() ;
Returns a pointer to a new JointBl
JointBl* NewElement()
;
Function is currently defined inline.
Back to the top of JointBl
Boolean Init(char* o_name, int o_num, FILE* fp);
Init function for SCF.
構造定義ファイル用 init 関数。"Init のための追加情報" 部分には、受
信端子の個数を書きます。
JointBl 3
Boolean Init(char* o_name, int o_num, FILE* fp);
Back to the top of JointBl
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 JointBl
JointBl(char* o_name, int o_num, int numinput) ;
Constructor
JointBl(char* o_name, int o_num, int numinput)
;
Function is currently defined inline.
Back to the top of JointBl
JointBl(void) ;
Default constructor
JointBl(void)
;
Function is currently defined inline.
Back to the top of JointBl
~JointBl(void) ;
Destructor
~JointBl(void)
;
Function is currently defined inline.
Back to the top of JointBl
void Set_parameter(FILE* fp) ;
Read in paramters
void Set_parameter(FILE* fp) {
fscanf(fp, "%d", &mDt);
for (int i; i < mNumRps; i++) fscanf(fp, "%lf", &(mA[i]));
}
void Set_parameter(FILE* fp)
;
Function is currently defined inline.
Back to the top of JointBl
void Set_port(int n);
Set the number of receive ports
void Set_port(int n);
Back to the top of JointBl
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 JointBl
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 JointBl
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 JointBl
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 JointBl
Boolean Initial_output(void);
初期時刻の入力を加算して,送信端子に書き出します。
Boolean Initial_output(void);
Back to the top of JointBl
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 JointBl
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 JointBl
Boolean Work(void) ;
計算時間間隔を決めてから calculate を実行する Work0 を採用していま
す。
Boolean Work(void)
;
Function is currently defined inline.
Back to the top of JointBl
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 JointBl
All Members
- public:
- char* Class_name(void) ;
- char* Object_name(void) ;
- int Object_number(void) ;
- void* Owner(void) ;
- Boolean Compare(char* c_name, char* o_name, int o_num);
- Boolean Compare(char* o_name, int o_num);
- Boolean Compare(Object* obj);
- Boolean Set_owner(void* o);
- void Cprint(FILE* fp_out, char* head);
- void Cprint(FILE* fp_out) ;
- void Cprint(char* head ) ;
- void Oprint(FILE* fp_out, char* head);
- void Oprint(FILE* fp_out) ;
- void Oprint(char* head ) ;
- void Absname( char* absname );
- Boolean Init(char* o_name, int o_num);
- enum OperationFlag ;
- Boolean Register(void* obj, int num);
- Boolean Construct(void);
- void* Get_receive_port(char* c_name, char* o_name, int o_num );
- void* Get_send_port(char* c_name, char* o_name, int o_num );
- void* Get_receive_port(char* o_name, int o_num );
- void* Get_send_port(char* o_name, int o_num );
- void* Get_object(char* c_name, char* o_name, int o_num );
- void* Get_component(char* c_name, char* o_name, int o_num ) ;
- void* Get_component(char* o_name, int o_num ) ;
- Boolean Switch(void);
- Boolean Are_you_ready(void);
- Boolean Set_data_string(char* d_str, int d_strlen );
- void Clear_data_string(void);
- Boolean Get_data_string(char* d_str);
- void Set_parameter(FILE* fp) ;
- void Parameter(FILE* fp, char*& buffer, int buflen, Boolean& stock_p);
- void Set_initial_state(FILE* fp) ;
- void Initial_state(FILE* fp, char*& buffer, int buflen, Boolean& stock_p);
- Boolean Share_info(void) ;
- void Save_send_port_stock(FILE* fp);
- void Restore_send_port_stock(void);
- time_t Current_time(void) ;
- time_t Time_step(void) ;
- time_t Next_time(void) ;
- time_t Terminal_time(void) ;
- time_t MediumTermTargetTime(void) ;
- time_t Fixed_time(void) ;
- time_t Target_time(void) ;
- void Rewind_current_time(void);
- void Renew_fixed_time(void);
- void Initialize_target_time(void) ;
- void Renew_target_time(time_t itrs);
- time_t Calculate_iteration_step(void);
- time_t Necessary_time_from(Receive_port* rp);
- time_t Necessary_time_to(Receive_port* rp);
- Boolean Initial_time(time_t i_time);
- Boolean Initial_work(void);
- Boolean Can_you_calculate(void) ;
- Boolean Record_status(void);
- Boolean Work(void) ;
- Boolean Do_you_reach_target_time(void);
- void Flush_data(void);
- void Creq(void) ;
- void Print_receive_ports(FILE* fp , char* head ) ;
- void Print_send_ports(FILE* fp , char* head ) ;
- void Print_connection(FILE* fp , char* head );
- void Save_terminal_state(FILE* fp) ;
- void Terminal_state(FILE* fp);
- Element* NewElement() ;
- Boolean Init(char*, int, FILE*) ;
- Boolean Init(char* o_name, int o_num, int num_of_objs , char* p_str ) ;
- Boolean Init(char* o_name, int o_num, char* p_str) ;
- JointBl* NewElement() ;
- Boolean Init(char* o_name, int o_num, FILE* fp);
- Boolean Init(char* o_name, int o_num, int numinput);
- void Set_port(int n);
- void Set_initial_state(time_t ct) ;
- void Save_terminal_state(time_t& ct) ;
- Boolean Initial_output(void);
- time_t Calculate_time_step(void) ;
- Boolean Calculate(void);
- protected:
- char* class_name;
- char* object_name;
- int object_number;
- void* owner;
- Boolean initialworkdone_p;
- Boolean shareinfodone_p;
- List* object_list;
- void** receive_port_array;
- int number_of_receive_ports;
- void** send_port_array;
- int number_of_send_ports;
- void** object_array;
- int number_of_objects;
- char* data_string;
- time_t current_time;
- time_t time_step;
- time_t fixed_time;
- time_t target_time;
- Boolean mCreqp;
- void* Get_from_list(char* c_name, char* o_name, int o_num);
- void* Get_from_list(char* o_name, int o_num);
- Boolean Register(void* obj);
- void Register_receive_ports(void) ;
- void Register_send_ports(void) ;
- Boolean Make_object_array(void**& obj_array, int& num_of_objs);
- Boolean Set_object_array(int num_of_objs);
- void* Get_from_array(char* c_name, char* o_name, int o_num, void** obj_array, int num_of_objs);
- void* Get_from_array(char* o_name, int o_num, void** obj_array, int num_of_objs);
- Boolean Look_data_string(char*& buffer);
- char* Get_line(FILE* fp, char* buffer, int buflen, Boolean& stock_p, int& iflag);
- void Get_line(FILE*fp, char* buffer, int buflen, char* fname, int line_number);
- void Cur2fix2tar(void) ;
- Boolean Renew_current_time(void) ;
- Boolean Can_you_calculate0(void);
- Boolean Can_you_calculate1(void);
- void Set_data_pack_array(void);
- void Reduce_data_pack_stock(void);
- Boolean Print_status(void) ;
- Boolean Work0(void);
- Boolean Work1(void);
- Boolean Work2(void);
- Boolean Work3(void);
- void Send_stocked_data(void);
- void Print_objects(FILE* fp, char* head, char* title, void** obj_array, int number_of_objs);
Back to the top of JointBl
Ancestors
Inheritance chain for JointBl:
Back to the top of JointBl
Descendants
Class is not inherited by any others.
Back to the top of JointBl
Generated from source by the Cocoon utilities on Sun Sep 3 22:52:02 2000
.
Report problems to jkotula@stratasys.com