Revize 662b2404
Přidáno uživatelem Roman Kalivoda před téměř 4 roky(ů)
Server/ServerApp/Predictor/FeatureExtractor.cs | ||
---|---|---|
52 | 52 |
} |
53 | 53 |
|
54 | 54 |
var res = new List<ModelInput>(); |
55 |
// TODO use iterators to access records about attendance and weather together |
|
56 |
foreach (Parser.OutputInfo.ActivityInfo val in dataParser.AttendanceList) { |
|
57 |
if (buildings.Contains(val.building)) { |
|
55 |
// use enumerator to access records about attendance and weather together |
|
56 |
IEnumerator<Parser.OutputInfo.WeatherInfo> weatherEnumerator = dataParser.WeatherList.GetEnumerator(); |
|
57 |
weatherEnumerator.MoveNext(); |
|
58 |
foreach (Parser.OutputInfo.ActivityInfo val in dataParser.AttendanceList) |
|
59 |
{ |
|
60 |
if (!weatherEnumerator.Current.startTime.Equals(val.startTime)) |
|
61 |
{ |
|
62 |
weatherEnumerator.MoveNext(); |
|
63 |
} |
|
64 |
if (buildings.Contains(val.building)) |
|
65 |
{ |
|
66 |
Parser.OutputInfo.WeatherInfo weatherInfo = weatherEnumerator.Current; |
|
58 | 67 |
res.Add(new ModelInput |
59 | 68 |
{ |
60 |
Temp = 0,
|
|
69 |
Temp = (float)weatherInfo.temp,
|
|
61 | 70 |
Time = val.startTime, |
71 |
Wind = (float)weatherInfo.wind, |
|
72 |
Rain = (float)weatherInfo.rain, |
|
62 | 73 |
// TODO convert val.amount to label |
63 | 74 |
}); |
64 | 75 |
} |
Také k dispozici: Unified diff
Re #8832 integration