-
Notifications
You must be signed in to change notification settings - Fork 0
/
Manager.cs
60 lines (55 loc) · 1.96 KB
/
Manager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WifiLocalization
{
class Manager : IManager
{
#region Manager Class Constructor
private static Manager _instance;
public static Manager Instance
{
get
{
if (_instance == null)
_instance = new Manager();
return _instance;
}
}
# endregion
/// <summary>
/// Uses PropertyModel.Thershold
/// Takes List<LocationModel(){original,predicted}>
/// </summary>
/// <returns>PropertyModel Statistics : Acc%,Avg,Max,Min</returns>
public PropertyModel GetStatistics(PropertyModel property, Double[] original, Double[] predicted)
{
return WifiLocalization.Implement.Instance.Statistics(property, original, predicted);
}
/// <summary>
/// Uses PropertyModel
/// Takes 1_OnlineReading and OfflineDB
/// </summary>
/// <returns>LocationModel :XValue,YValue</returns>
public Double[] ReadOfflineDB(string xlPath, int xlSheetNum, string xlRangestring)
{
Array Data = WifiLocalization.Implement.Instance.ExcelRead(xlPath, xlSheetNum, xlRangestring);
return Helper.ObjectToDouble(Data);
}
public DeviceModel GetLocation(DeviceModel user, LocationModel offline)
{
return KNearestNeighbor(user, offline);
// return WKNearestNeighbor(user, offline);
}
private DeviceModel KNearestNeighbor(DeviceModel user, LocationModel offline)
{
return WifiLocalization.Implement.Instance.KNearestNeighbor(user,offline);
}
private DeviceModel WKNearestNeighbor(DeviceModel user, LocationModel offline)
{
return WifiLocalization.Implement.Instance.WKNearestNeighbor();
}
}
}