public void CreateLiveCollection() { LiveDataETL.LiveDataETLs lde = new LiveDataETL.LiveDataETLs(); StagingETLs ses = new StagingETLs(); var docs = lde.mongo_LiveDataETL.QueryMongo(); foreach (var doc in docs) { var std = ses.mongo_StagingETLs.QueryMongo().Where(e => e._id == doc._id).FirstOrDefault(); if (std == null) continue; ScorePredictDocument spd = new ScorePredictDocument(); spd._id = doc._id; spd.match_time = doc.match_time; spd.match_type = doc.match_type; spd.home_team = doc.home_team; spd.home_team_big = doc.home_team_big; spd.away_team_big = doc.away_team_big; spd.away_team = doc.away_team; spd.asia_odds = doc.asia_odds; spd.grnn_310values = std.grnn_310values; spd.grnn_home_goals = std.grnn_home_goals; spd.grnn_away_goals = std.grnn_away_goals; spd.pnn_310values = std.pnn_310values; mongo_ScorePredict.MongoDropColCreateCol.Insert(spd); } Console.WriteLine("mongo_ScorePredict->mongo->ok"); }
static void Main(string[] args) { #if abcd int overday = 365 * 4; using (LiveDataETLs lcb = new LiveDataETLs()) { lcb.CreateResultCollection(overday); lcb.CreateLiveCollection(); } GC.Collect(); #endif #if abcd using (HistoryDataTopDetail lcbs = new HistoryDataTopDetail()) lcbs.CreateCollection(); GC.Collect(); using (HistoryDataCalculate lcbs = new HistoryDataCalculate()) lcbs.CreateCollection(); GC.Collect(); DataMingForMatlab.DataMingForMatlabs.CreateSimCollection(); DataMingForMatlab.DataMingForMatlabs.DoSimulink(); using (StagingETLs sts = new StagingETLs()) sts.CreateLiveCollection(); GC.Collect(); #endif #if abc using (ScorePredict sp = new ScorePredict()) sp.CreateLiveCollection(); GC.Collect(); using (ScorePredictForCn sp = new ScorePredictForCn()) sp.CreateLiveCollection(); GC.Collect(); //预测结束 #endif #if abc //csv和email观察预测结果 string filename = @"ScorePredictForCn.csv"; ScorePredictForCn smo = new ScorePredictForCn(); var today_ma = smo.mongo_ScorePredictForCn.QueryMongo(); DataTable dt1 = today_ma.CopyDataTable(); DataTableToTxt.DataTable2TxtAll(dt1, filename); Console.WriteLine("ScorePredictForCnToTxt->mongo->ok"); SendPredictEmail.SendMail(filename); #endif #if abc //写入csv给R研究用 DataMingForRs.MatchNowToTxt(); DataMingForRs.MatchOverToTxt(); #endif Console.ReadKey(); }