Weather casting with Machine Learning (SVM and SRNN).
Dependencies: EthernetInterface GraphicHandler NTPClient SRNN SVM SensorModule mbed-rtos mbed
main.cpp
- Committer:
- yukari_hinata
- Date:
- 2015-02-16
- Revision:
- 1:8538381cae81
- Parent:
- 0:f6cdb984f638
- Child:
- 2:20ecfe6edd71
File content as of revision 1:8538381cae81:
#include "main.hpp" LocalFileSystem *local_fs; // マウントポイントを定義(ディレクトリパスになる) // 時間(global) time_t global_time; // 現在時刻 Mutex time_mutex; // 時間のMutex // Pointer to Class instance (global) SRNN *srnn; MCSVM *mcsvm; SensorModule *sensor_module; GraphicHandler *graphic_handler; // ネットワーク関係(global) EthernetInterface eth_if; TCPSocketServer http_server; NTPClient ntp_client; // 系列データ float* new_seqence_data; // 現在の(一番新しい)系列データ float* new_predict_data; // 現在の予測結果 int* new_predict_weather; // 現在の予測天気 float* new_predict_probability; // 現在の予測天気の確率(厳密には,確率ではない...) FILE* seqence_data_fp; // 系列データのファイルポインタ(SRNNと計器の記録に使う) FILE* predict_data_fp; // 予測データ Mutex seqence_data_mutex; // 系列データのMutex Mutex predict_data_mutex; // 予測データのMutex // 計器/機械学習スレッド void read_and_predict_thread(void const *arg) { // 1. 定期的(周期はmainが指定)にセンサーから読み出す // 2. 記録(記録ファイルが長くなっていたら, 削る) // 3. SRNNに学習データを読み込ませる.(Mutexを使う) // 4. SRNNの学習/予測結果から, MCSVMで天気識別 // 5. 予測結果のセット, 書き込み } // 描画スレッド : 優先度低め void draw_thread(void const *arg) { // 1. 1分に一回, 時間を取りにいく // 2. 描画更新 <- 学習中は止めたい... } // ネットワークスレッド void network_thread(void const *arg) { // 1. たまに時間を更新 // 2. ポート80のListen <- 学習中は止めたい... } // エントリ. スレッドの生成, そして待つ int main(void) { set_new_handler(no_memory); local_fs = new LocalFileSystem("local"); setup(); printf("EXIT SUCESS!! \r\n"); return 0; }