SET(target "${target_prefix}-my-place")
+SET(target_myplace_utils_static "${target}-utils_static")
+
+INCLUDE_DIRECTORIES(utils)
SET(DEPS ${DEPS}
gmodule-2.0
capi-network-wifi
)
-FILE(GLOB SRCS *.cpp facade/*.cpp utils/*.cpp visit-detector/*.cpp)
+FILE(GLOB SRCS *.cpp facade/*.cpp visit-detector/*.cpp)
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PKG_MYPLACE REQUIRED ${DEPS})
ENDFOREACH(flag)
ADD_LIBRARY(${target} SHARED ${SRCS})
-TARGET_LINK_LIBRARIES(${target} ${PKG_MYPLACE_LDFLAGS} ${target_shared})
+TARGET_LINK_LIBRARIES(${target} ${PKG_MYPLACE_LDFLAGS} ${target_shared} ${target_myplace_utils_static})
INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}/${target_dir})
+ADD_SUBDIRECTORY(utils)
ADD_SUBDIRECTORY(place)
ADD_SUBDIRECTORY(visit-categer)
\ No newline at end of file
#include <TimerManager.h>
#include <ITimerListener.h>
#include "../visit-detector/VisitDetector.h"
-#include "../place/PlacesDetector.h"
-#include "UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
namespace ctx {
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _CONTEXT_PLACE_RECOGNITION_USER_PLACES_PARAMS_H_
-#define _CONTEXT_PLACE_RECOGNITION_USER_PLACES_PARAMS_H_
-
-/*
- * WiFi scanning frequency (in minutes) in PLACE_RECOG_HIGH_ACCURACY_MODE.
- */
-#define WIFI_LOGGER_INTERVAL_MINUTES_HIGH_ACCURACY 3
-
-/*
- * WiFi scanning frequency (in minutes) in PLACE_RECOG_LOW_POWER_MODE.
- */
-#define WIFI_LOGGER_INTERVAL_MINUTES_LOW_POWER 60
-
-/*
- * Time window taken into consideration (in seconds) in PLACE_RECOG_HIGH_ACCURACY_MODE.
- */
-#define VISIT_DETECTOR_PERIOD_SECONDS_HIGH_ACCURACY 360
-
-/*
- * Time window taken into consideration (in seconds) in PLACE_RECOG_LOW_POWER_MODE.
- */
-#define VISIT_DETECTOR_PERIOD_SECONDS_LOW_POWER 3600
-
-/*
- * Overlap threshold between two sets of mac addresses (overlap
- * coefficient for two sets should be higher than this threshold
- * in order to detect stable radio environment); =< 1.0
- * New parameter in algorithm compared to original version of PlaceSense!
- */
-#define VISIT_DETECTOR_OVERLAP 0.8f
-
-/*
- * Specifies how many stable intervals must be seen to
- * indicate an entrance to a place; >= 1
- */
-#define VISIT_DETECTOR_STABLE_DEPTH 1
-
-/*
- * Representatives threshold (representatnive beacon
- * response rate should be higher than this threshold); =< 1.0
- */
-#define VISIT_DETECTOR_REP_THRESHOLD 0.9f
-
-/*
- * Specifies how long scans must be unstable to indicate a leave form a place; >= 1
- */
-#define VISIT_DETECTOR_TOLERANCE_DEPTH 3
-
-#define PLACES_DETECTOR_TASK_START_HOUR 3
-#define PLACES_DETECTOR_TASK_START_MINUTE 11
-#define PLACES_DETECTOR_RETENTION_DAYS 30
-#define PLACES_DETECTOR_RETENTION_SECONDS 24 * 60 * 60 * PLACES_DETECTOR_RETENTION_DAYS
-
-/*
- * Minimal duration of visit (in minutes) taking into account for place detection
- */
-#define PLACES_DETECTOR_MIN_VISIT_DURATION_MINUTES 15
-
-/*
- * Maximum duration of visit (in minutes) taking into account for place detection
- */
-#define PLACES_DETECTOR_MAX_VISIT_DURATION_MINUTES 5 * 24 * 60
-
-/*
- * Minimum visits number per place
- */
-#define PLACES_DETECTOR_MIN_VISITS_PER_PLACE 1
-
-/*
- * Minimum visits number per big place
- */
-#define PLACES_DETECTOR_MIN_VISITS_PER_BIG_PLACE 4
-
-/*
- * Minimal visit category score for taking this visit into consideration during
- * place categorization
- */
-#define PLACES_CATEGER_MIN_VISITS_SCORE 0.1
-
-/*
- * Minimum visits number per home
- */
-#define PLACES_CATEGER_MIN_VISITS_PER_HOME 3
-
-/*
- * Minimum visits number per work
- */
-#define PLACES_CATEGER_MIN_VISITS_PER_WORK 2
-
-/*
- * Default user consent value for place detection
- */
-#define MYPLACE_SETTING_USER_CONSENT_DEFAULT false
-
-#endif /* End of _CONTEXT_PLACE_RECOGNITION_USER_PLACES_PARAMS_H_ */
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <set>
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-#include <algorithm>
-#include <Types.h>
-#include "UserPlacesTypes.h"
-#include "UserPlacesParams.h"
-#include "../utils/DebugUtils.h"
-
-#define __MAC_STRING_COMPONENTS_SEPARATOR ':'
-#define __MAC_SET_STRING_DELIMITER ','
-
-ctx::Mac::Mac(const std::string& str)
-{
- std::stringstream ss(str);
- try {
- ss >> *this;
- } catch (std::runtime_error &e) {
- _E("%s", e.what());
- }
-}
-
-ctx::Mac::Mac(const char *str)
-{
- std::stringstream ss(str);
- try {
- ss >> *this;
- } catch (std::runtime_error &e) {
- _E("%s", e.what());
- }
-}
-
-std::istream& ctx::operator>>(std::istream &input, ctx::Mac &mac)
-{
- int h;
- char colon;
- for (size_t i = 0; i < ctx::Mac::MAC_SIZE; i++) {
- input >> std::hex;
- input >> h;
- mac.c[i] = h;
- if (i + 1 >= ctx::Mac::MAC_SIZE)
- break;
- input >> colon;
- if (colon != __MAC_STRING_COMPONENTS_SEPARATOR)
- throw std::runtime_error("Invalid MAC format");
- }
- input >> std::dec;
- return input;
-}
-
-std::ostream& ctx::operator<<(std::ostream &output, const ctx::Mac &mac)
-{
- size_t i = 0;
- while (true) {
- output << std::hex << std::setfill('0') << std::setw(2);
- output << static_cast<int>(mac.c[i]);
- i++;
- if (i >= Mac::MAC_SIZE)
- break;
- output << __MAC_STRING_COMPONENTS_SEPARATOR;
- }
- output << std::dec;
- return output;
-}
-
-ctx::Mac::operator std::string() const
-{
- std::stringstream ss;
- ss << *this;
- return ss.str();
-}
-
-bool ctx::operator==(const Mac &m1, const Mac &m2)
-{
- for (size_t i = 0; i < Mac::MAC_SIZE; i++) {
- if (m1.c[i] != m2.c[i])
- return false;
- }
- return true;
-}
-
-bool ctx::operator!=(const Mac &m1, const Mac &m2)
-{
- return !(m1 == m2);
-}
-
-bool ctx::operator<(const Mac &m1, const Mac &m2)
-{
- unsigned char c1, c2;
- for (size_t i = 0; i < Mac::MAC_SIZE; i++) {
- c1 = m1.c[i];
- c2 = m2.c[i];
- if (c1 < c2)
- return true;
- if (c1 > c2)
- return false;
- }
- return false; // they are equal
-}
-
-std::istream& ctx::operator>>(std::istream &input, ctx::MacSet &macSet)
-{
- Mac mac;
- char delimeter;
- while (!input.eof()) {
- try {
- input >> mac;
- } catch (std::runtime_error &e) {
- _E("Cannot read macSet. Exception: %s", e.what());
- break;
- }
- macSet.insert(mac);
- if (input.eof())
- break;
- delimeter = input.get();
- if (delimeter != __MAC_SET_STRING_DELIMITER) {
- input.unget();
- break;
- }
- }
- return input;
-}
-
-std::ostream& ctx::operator<<(std::ostream &output, const ctx::MacSet &macSet)
-{
- std::vector<Mac> macVec(macSet.size());
- std::copy(macSet.begin(), macSet.end(), macVec.begin());
- std::sort(macVec.begin(), macVec.end());
-
- bool first = true;
- for (auto &mac: macVec) {
- if (first) {
- first = false;
- } else {
- output << __MAC_SET_STRING_DELIMITER;
- }
- output << mac;
- }
- return output;
-}
-
-void ctx::LocationEvent::log()
-{
- std::string time_str = DebugUtils::humanReadableDateTime(timestamp, "%T", 9);
-#ifdef TIZEN_ENGINEER_MODE
- _D("location lat=%.8f, lon=%.8f, acc=%.2f[m], time=%s, method=%d",
- coordinates.latitude,
- coordinates.longitude,
- coordinates.accuracy,
- time_str.c_str(),
- method);
-#else /* TIZEN_ENGINEER_MODE */
- _D("location lat=%.8f, lon=%.8f, acc=%.2f[m], time=%s",
- coordinates.latitude,
- coordinates.longitude,
- coordinates.accuracy,
- time_str.c_str());
-#endif /* TIZEN_ENGINEER_MODE */
-}
-
-void ctx::Visit::setLocation(Location location_)
-{
- locationValid = true;
- location = location_;
-}
-
-void ctx::Visit::printShort2Stream(std::ostream &out) const
-{
- // print only valid visits
- if (interval.end != 0) {
- float duration = ((float) (interval.end - interval.start)) / 3600; // [h]
- out << "__VISIT " << duration << "h: ";
- out << DebugUtils::humanReadableDateTime(interval.start, "%m/%d %H:%M", 15) << " ÷ ";
- out << DebugUtils::humanReadableDateTime(interval.end, "%m/%d %H:%M", 15) << std::endl;
- }
-}
-
-bool ctx::operator==(const ctx::Visit &v1, const ctx::Visit &v2)
-{
- return v1.interval.start == v2.interval.start
- && v1.interval.end == v2.interval.end
- && v1.categs == v2.categs
- && v1.location.latitude == v2.location.latitude
- && v1.location.longitude == v2.location.longitude
- && v1.location.accuracy == v2.location.accuracy
- && v1.locationValid == v2.locationValid
- && v1.macSet == v2.macSet;
-}
-
-ctx::MacSet ctx::macSetFromString(const std::string &str)
-{
- MacSet macSet;
- std::stringstream ss;
- ss << str;
- ss >> macSet;
- return macSet;
-}
-
-bool ctx::operator>(const Mac &m1, const Mac &m2)
-{
- return m2 < m1;
-}
-
-std::shared_ptr<ctx::MacSet> ctx::macSetFromMacs2Counts(const Macs2Counts &macs2Counts)
-{
- std::shared_ptr<MacSet> macSet(std::make_shared<MacSet>());
- for (auto &macCount: macs2Counts) {
- macSet->insert(macCount.first);
- }
- return macSet;
-}
-
-std::shared_ptr<ctx::MacSet> ctx::macSetsUnion(const std::vector<std::shared_ptr<MacSet>> &macSets)
-{
- std::shared_ptr<MacSet> unionSet = std::make_shared<MacSet>();
- for (std::shared_ptr<MacSet> macSet : macSets) {
- unionSet->insert(macSet->begin(), macSet->end());
- }
- return unionSet;
-}
-
-ctx::Interval::Interval(time_t start_, time_t end_) : start(start_), end(end_) {
- if (end_ < start_)
- _E("Negative interval, start=%d, end=%d", start_, end_);
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _CONTEXT_PLACE_RECOGNITION_USER_PLACES_TYPES_H_
-#define _CONTEXT_PLACE_RECOGNITION_USER_PLACES_TYPES_H_
-
-#include <memory>
-#include <vector>
-#include <map>
-#include <unordered_map>
-#include <unordered_set>
-#include <string>
-#include <ctime>
-#include <MyPlaceTypes.h>
-
-// Database
-#define VISIT_TABLE "Log_Myplace_Visit"
-#define VISIT_COLUMN_START_TIME "start_time"
-#define VISIT_COLUMN_END_TIME "end_time"
-#define VISIT_COLUMN_WIFI_APS "wifi_aps"
-#define VISIT_COLUMN_CATEGORY "category"
-#ifdef TIZEN_ENGINEER_MODE
-#define VISIT_COLUMN_START_TIME_HUMAN "start_time_human" // only for debug: human readable time data:
-#define VISIT_COLUMN_END_TIME_HUMAN "end_time_human" // only for debug: human readable time data:
-#endif /* TIZEN_ENGINEER_MODE */
-#define VISIT_COLUMN_LOCATION_VALID "location_valid"
-#define VISIT_COLUMN_LOCATION_LATITUDE "location_latitude"
-#define VISIT_COLUMN_LOCATION_LONGITUDE "location_longitude"
-#define VISIT_COLUMN_LOCATION_ACCURACY "location_accuracy"
-#define VISIT_COLUMN_CATEG_HOME "categ_home"
-#define VISIT_COLUMN_CATEG_WORK "categ_work"
-#define VISIT_COLUMN_CATEG_OTHER "categ_other"
-
-#define WIFI_APS_MAP_TABLE "Log_Myplace_WifiAPsMap"
-#define WIFI_APS_MAP_COLUMN_MAC "mac"
-#define WIFI_APS_MAP_COLUMN_NETWORK_NAME "network_name"
-#define WIFI_APS_MAP_COLUMN_INSERT_TIME "insert_time"
-
-#define PLACE_TABLE "Log_Myplace_Place"
-#define PLACE_COLUMN_CATEG_ID "categ_id"
-#define PLACE_COLUMN_CATEG_CONFIDENCE "categ_confidence"
-#define PLACE_COLUMN_NAME "name"
-#define PLACE_COLUMN_LOCATION_VALID "location_valid"
-#define PLACE_COLUMN_LOCATION_LATITUDE "location_latitude"
-#define PLACE_COLUMN_LOCATION_LONGITUDE "location_longitude"
-#define PLACE_COLUMN_LOCATION_ACCURACY "location_accuracy"
-#define PLACE_COLUMN_WIFI_APS "wifi_aps"
-#define PLACE_COLUMN_CREATE_DATE "create_date"
-
-#define WIFI_TABLE "Log_Myplace_Wifi"
-#define WIFI_COLUMN_TIMESTAMP "timestamp"
-#define WIFI_COLUMN_BSSID "bssid"
-#define WIFI_COLUMN_ESSID "essid"
-
-#define LOCATION_TABLE "Log_Myplace_Location"
-#define LOCATION_COLUMN_LATITUDE "latitude"
-#define LOCATION_COLUMN_LONGITUDE "longitude"
-#define LOCATION_COLUMN_ACCURACY "accuracy"
-#define LOCATION_COLUMN_TIMESTAMP "timestamp"
-#ifdef TIZEN_ENGINEER_MODE
-#define LOCATION_COLUMN_TIMESTAMP_HUMAN "time_human" // only for debug: human readable time data:
-#define LOCATION_COLUMN_METHOD "method"
-#endif /* TIZEN_ENGINEER_MODE */
-
-#define MYPLACE_SETTINGS_TABLE "Myplace_Settings"
-#define MYPLACE_SETTINGS_COLUMN_KEY "key"
-#define MYPLACE_SETTINGS_COLUMN_VALUE "value"
-#define MYPLACE_SETTING_KEY_USER_CONSENT PLACE_DETECTION_REQUEST_CONSENT
-
-enum PlaceRecogMode {
- PLACE_RECOG_HIGH_ACCURACY_MODE = 0,
- PLACE_RECOG_LOW_POWER_MODE = 1
-};
-
-namespace ctx {
-
- /*
- * type for numerical computations
- */
- typedef double num_t;
-
- /*
- * mac address
- */
- class Mac {
-
- public:
- const static size_t MAC_SIZE = 6; // number of bytes for mac address.
- unsigned char c[MAC_SIZE];
-
- Mac() {};
- Mac(const std::string &str);
- Mac(const char *str);
- operator std::string() const;
-
- }; /* class Mac */
-
- std::istream &operator>>(std::istream &input, ctx::Mac &mac);
- std::ostream &operator<<(std::ostream &output, const ctx::Mac &mac);
- bool operator==(const ctx::Mac &m1, const ctx::Mac &m2);
- bool operator!=(const ctx::Mac &m1, const ctx::Mac &m2);
- bool operator<(const ctx::Mac &m1, const ctx::Mac &m2);
- bool operator>(const ctx::Mac &m1, const ctx::Mac &m2);
-
-} /* namespace ctx */
-
-namespace std {
-
- template <> struct hash<ctx::Mac> {
- size_t operator()(const ctx::Mac & m) const {
- size_t h = 1;
- for (size_t i = 0; i < ctx::Mac::MAC_SIZE; i++) {
- h = h * 37 + m.c[i];
- }
- return h;
- }
- };
-
-} /* namespace std */
-
-namespace ctx {
-
- typedef float share_t;
- typedef int count_t;
-
- typedef std::unordered_map<ctx::Mac, ctx::count_t> Macs2Counts;
- typedef std::unordered_map<ctx::Mac, ctx::share_t> Macs2Shares;
-
- typedef std::unordered_set<ctx::Mac> MacSet;
-
- std::istream &operator>>(std::istream &input, ctx::MacSet &macSet);
- std::ostream &operator<<(std::ostream &output, const ctx::MacSet &macSet);
- ctx::MacSet macSetFromString(const std::string &str);
-
- std::shared_ptr<MacSet> macSetsUnion(const std::vector<std::shared_ptr<MacSet>> &macSets);
-
- struct Interval {
- time_t start;
- time_t end;
-
- Interval(time_t start, time_t end);
- };
-
-} /* namespace ctx */
-
-namespace std {
-
- template <> struct hash<ctx::Interval> {
- size_t operator()(const ctx::Interval & interval) const {
- return interval.end * interval.start;
- }
- };
-
-} /* namespace std */
-
-namespace ctx {
-
- /*
- * fully describes interval data after the interval is finished
- */
- struct Frame {
- Interval interval;
- count_t numberOfTimestamps;
- Macs2Counts macs2Counts;
-
- Frame(Interval interval_) : interval(interval_), numberOfTimestamps(0) {};
- };
-
- /*
- * mac address + its timestamp
- */
- struct MacEvent {
- time_t timestamp;
- Mac mac;
- std::string networkName;
-
- MacEvent(time_t timestamp_, Mac mac_, std::string networkName_ = "")
- : timestamp(timestamp_)
- , mac(mac_)
- , networkName(networkName_) {}
- };
-
- typedef std::map<int, num_t> Categs; // scores of categories
-
-#ifdef TIZEN_ENGINEER_MODE
- enum LocationSource {
- LOCATION_METHOD_REQUEST = 0,
- LOCATION_METHOD_GET_LOCATION = 1,
- LOCATION_METHOD_GET_LAST_LOCATION = 2
- };
-#endif /* TIZEN_ENGINEER_MODE */
-
- /*
- * location + timestamp + method
- */
- struct LocationEvent {
- Location coordinates;
- time_t timestamp;
-
-#ifdef TIZEN_ENGINEER_MODE
- LocationSource method;
-
- LocationEvent(double latitude_, double longitude_, double accuracy_, time_t timestamp_, LocationSource method_) :
- coordinates(latitude_, longitude_, accuracy_),
- timestamp(timestamp_), method(method_) {}
-#else /* TIZEN_ENGINEER_MODE */
- LocationEvent(double latitude_, double longitude_, double accuracy_, time_t timestamp_) :
- coordinates(latitude_, longitude_, accuracy_),
- timestamp(timestamp_) {}
-#endif /* TIZEN_ENGINEER_MODE */
-
- void log();
-
- }; /* struct LocationEvent */
-
- struct Visit {
- Interval interval;
- std::shared_ptr<MacSet> macSet;
- Categs categs;
- bool locationValid;
- Location location; // makes sense if locationValid == true;
-
- Visit(Interval interval_, std::shared_ptr<MacSet> macSet_ = std::make_shared<MacSet>(), Categs categs_ = Categs()) :
- interval(interval_),
- macSet(macSet_),
- categs(categs_),
- locationValid(false) {}
- void setLocation(Location location);
- void printShort2Stream(std::ostream &out) const;
-
- }; /* struct Visit */
-
- bool operator==(const Visit &v1, const Visit &v2);
- typedef std::vector<Visit> Visits;
- typedef std::vector<MacEvent> MacEvents; // used to store current interval logs
-
- std::shared_ptr<MacSet> macSetFromMacs2Counts(const Macs2Counts &macs2Counts);
-
-} /* namespace ctx */
-
-#endif /* End of _CONTEXT_PLACE_RECOGNITION_USER_PLACES_TYPES_H_ */
SET(target "${target_prefix}-my-place-places-detector")
+INCLUDE_DIRECTORIES(../utils)
+
FILE(GLOB SRCS *.cpp)
ADD_LIBRARY(${target} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${target} ${target_myplace_utils_static})
INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}/${target_dir})
\ No newline at end of file
*/
#include "PlaceCateger.h"
-#include "../utils/Median.h"
-#include "../facade/UserPlacesParams.h"
-#include "../facade/UserPlacesTypes.h"
+#include <Median.h>
+#include <UserPlacesParams.h>
+#include <UserPlacesTypes.h>
#include <algorithm>
#include <Types.h>
#ifndef _CONTEXT_PLACE_RECOGNITION_PLACE_CATEGER_
#define _CONTEXT_PLACE_RECOGNITION_PLACE_CATEGER_
-#include "../facade/UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
#include <utility>
#include <vector>
#include <string>
#include <sstream>
#include <Types.h>
#include <Json.h>
-#include "../utils/Similarity.h"
+#include <Similarity.h>
#include "PlacesDetector.h"
#include "PlaceCateger.h"
-#include "../utils/Median.h"
+#include <Median.h>
#ifdef TIZEN_ENGINEER_MODE
-#include "../utils/Gmap.h"
+#include <Gmap.h>
#endif /* TIZEN_ENGINEER_MODE */
-#include "../facade/UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
#include <fstream>
#include <algorithm>
-#include "../facade/UserPlacesParams.h"
-#include "../utils/DebugUtils.h"
+#include <UserPlacesParams.h>
+#include <DebugUtils.h>
#include <DatabaseManager.h>
#define __DELETE_PLACES_QUERY "DELETE FROM " PLACE_TABLE
{
double value;
row.get(NULL, key, &value);
- _D("__doubleValueFromJson, key:%s, value: %lf", key, value);
+ _D("key: %s, value: %lf", key, value);
return value;
}
#include <vector>
#include <cstdint>
#include <ITimerListener.h>
-#include "../facade/UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
#include <MyPlaceTypes.h>
#include "Graph.h"
--- /dev/null
+SET(target ${target_myplace_utils_static})
+
+FILE(GLOB SRCS *.cpp)
+
+ADD_LIBRARY(${target} STATIC ${SRCS})
\ No newline at end of file
#ifndef _CONTEXT_PLACE_RECOGNITION_GMAP_H_
#define _CONTEXT_PLACE_RECOGNITION_GMAP_H_
-#include "../facade/UserPlacesTypes.h"
+#include "UserPlacesTypes.h"
#define GMAP_FILE "/tmp/user_places_map.html"
#ifndef _CONTEXT_PLACE_RECOGNITION_MEDIAN_
#define _CONTEXT_PLACE_RECOGNITION_MEDIAN_
-#include "../facade/UserPlacesTypes.h"
+#include "UserPlacesTypes.h"
#include <vector>
namespace ctx {
#ifndef _CONTEXT_PLACE_RECOGNITION_SIMILAR_H_
#define _CONTEXT_PLACE_RECOGNITION_SIMILAR_H_
-#include "../facade/UserPlacesTypes.h"
+#include "UserPlacesTypes.h"
namespace ctx {
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CONTEXT_PLACE_RECOGNITION_USER_PLACES_PARAMS_H_
+#define _CONTEXT_PLACE_RECOGNITION_USER_PLACES_PARAMS_H_
+
+/*
+ * WiFi scanning frequency (in minutes) in PLACE_RECOG_HIGH_ACCURACY_MODE.
+ */
+#define WIFI_LOGGER_INTERVAL_MINUTES_HIGH_ACCURACY 3
+
+/*
+ * WiFi scanning frequency (in minutes) in PLACE_RECOG_LOW_POWER_MODE.
+ */
+#define WIFI_LOGGER_INTERVAL_MINUTES_LOW_POWER 60
+
+/*
+ * Time window taken into consideration (in seconds) in PLACE_RECOG_HIGH_ACCURACY_MODE.
+ */
+#define VISIT_DETECTOR_PERIOD_SECONDS_HIGH_ACCURACY 360
+
+/*
+ * Time window taken into consideration (in seconds) in PLACE_RECOG_LOW_POWER_MODE.
+ */
+#define VISIT_DETECTOR_PERIOD_SECONDS_LOW_POWER 3600
+
+/*
+ * Overlap threshold between two sets of mac addresses (overlap
+ * coefficient for two sets should be higher than this threshold
+ * in order to detect stable radio environment); =< 1.0
+ * New parameter in algorithm compared to original version of PlaceSense!
+ */
+#define VISIT_DETECTOR_OVERLAP 0.8f
+
+/*
+ * Specifies how many stable intervals must be seen to
+ * indicate an entrance to a place; >= 1
+ */
+#define VISIT_DETECTOR_STABLE_DEPTH 1
+
+/*
+ * Representatives threshold (representatnive beacon
+ * response rate should be higher than this threshold); =< 1.0
+ */
+#define VISIT_DETECTOR_REP_THRESHOLD 0.9f
+
+/*
+ * Specifies how long scans must be unstable to indicate a leave form a place; >= 1
+ */
+#define VISIT_DETECTOR_TOLERANCE_DEPTH 3
+
+#define PLACES_DETECTOR_TASK_START_HOUR 3
+#define PLACES_DETECTOR_TASK_START_MINUTE 11
+#define PLACES_DETECTOR_RETENTION_DAYS 30
+#define PLACES_DETECTOR_RETENTION_SECONDS 24 * 60 * 60 * PLACES_DETECTOR_RETENTION_DAYS
+
+/*
+ * Minimal duration of visit (in minutes) taking into account for place detection
+ */
+#define PLACES_DETECTOR_MIN_VISIT_DURATION_MINUTES 15
+
+/*
+ * Maximum duration of visit (in minutes) taking into account for place detection
+ */
+#define PLACES_DETECTOR_MAX_VISIT_DURATION_MINUTES 5 * 24 * 60
+
+/*
+ * Minimum visits number per place
+ */
+#define PLACES_DETECTOR_MIN_VISITS_PER_PLACE 1
+
+/*
+ * Minimum visits number per big place
+ */
+#define PLACES_DETECTOR_MIN_VISITS_PER_BIG_PLACE 4
+
+/*
+ * Minimal visit category score for taking this visit into consideration during
+ * place categorization
+ */
+#define PLACES_CATEGER_MIN_VISITS_SCORE 0.1
+
+/*
+ * Minimum visits number per home
+ */
+#define PLACES_CATEGER_MIN_VISITS_PER_HOME 3
+
+/*
+ * Minimum visits number per work
+ */
+#define PLACES_CATEGER_MIN_VISITS_PER_WORK 2
+
+/*
+ * Default user consent value for place detection
+ */
+#define MYPLACE_SETTING_USER_CONSENT_DEFAULT false
+
+#endif /* End of _CONTEXT_PLACE_RECOGNITION_USER_PLACES_PARAMS_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <set>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <algorithm>
+#include <Types.h>
+#include "UserPlacesTypes.h"
+#include "UserPlacesParams.h"
+#include "DebugUtils.h"
+
+#define __MAC_STRING_COMPONENTS_SEPARATOR ':'
+#define __MAC_SET_STRING_DELIMITER ','
+
+ctx::Mac::Mac(const std::string& str)
+{
+ std::stringstream ss(str);
+ try {
+ ss >> *this;
+ } catch (std::runtime_error &e) {
+ _E("%s", e.what());
+ }
+}
+
+ctx::Mac::Mac(const char *str)
+{
+ std::stringstream ss(str);
+ try {
+ ss >> *this;
+ } catch (std::runtime_error &e) {
+ _E("%s", e.what());
+ }
+}
+
+std::istream& ctx::operator>>(std::istream &input, ctx::Mac &mac)
+{
+ int h;
+ char colon;
+ for (size_t i = 0; i < ctx::Mac::MAC_SIZE; i++) {
+ input >> std::hex;
+ input >> h;
+ mac.c[i] = h;
+ if (i + 1 >= ctx::Mac::MAC_SIZE)
+ break;
+ input >> colon;
+ if (colon != __MAC_STRING_COMPONENTS_SEPARATOR)
+ throw std::runtime_error("Invalid MAC format");
+ }
+ input >> std::dec;
+ return input;
+}
+
+std::ostream& ctx::operator<<(std::ostream &output, const ctx::Mac &mac)
+{
+ size_t i = 0;
+ while (true) {
+ output << std::hex << std::setfill('0') << std::setw(2);
+ output << static_cast<int>(mac.c[i]);
+ i++;
+ if (i >= Mac::MAC_SIZE)
+ break;
+ output << __MAC_STRING_COMPONENTS_SEPARATOR;
+ }
+ output << std::dec;
+ return output;
+}
+
+ctx::Mac::operator std::string() const
+{
+ std::stringstream ss;
+ ss << *this;
+ return ss.str();
+}
+
+bool ctx::operator==(const Mac &m1, const Mac &m2)
+{
+ for (size_t i = 0; i < Mac::MAC_SIZE; i++) {
+ if (m1.c[i] != m2.c[i])
+ return false;
+ }
+ return true;
+}
+
+bool ctx::operator!=(const Mac &m1, const Mac &m2)
+{
+ return !(m1 == m2);
+}
+
+bool ctx::operator<(const Mac &m1, const Mac &m2)
+{
+ unsigned char c1, c2;
+ for (size_t i = 0; i < Mac::MAC_SIZE; i++) {
+ c1 = m1.c[i];
+ c2 = m2.c[i];
+ if (c1 < c2)
+ return true;
+ if (c1 > c2)
+ return false;
+ }
+ return false; // they are equal
+}
+
+std::istream& ctx::operator>>(std::istream &input, ctx::MacSet &macSet)
+{
+ Mac mac;
+ char delimeter;
+ while (!input.eof()) {
+ try {
+ input >> mac;
+ } catch (std::runtime_error &e) {
+ _E("Cannot read macSet. Exception: %s", e.what());
+ break;
+ }
+ macSet.insert(mac);
+ if (input.eof())
+ break;
+ delimeter = input.get();
+ if (delimeter != __MAC_SET_STRING_DELIMITER) {
+ input.unget();
+ break;
+ }
+ }
+ return input;
+}
+
+std::ostream& ctx::operator<<(std::ostream &output, const ctx::MacSet &macSet)
+{
+ std::vector<Mac> macVec(macSet.size());
+ std::copy(macSet.begin(), macSet.end(), macVec.begin());
+ std::sort(macVec.begin(), macVec.end());
+
+ bool first = true;
+ for (auto &mac: macVec) {
+ if (first) {
+ first = false;
+ } else {
+ output << __MAC_SET_STRING_DELIMITER;
+ }
+ output << mac;
+ }
+ return output;
+}
+
+void ctx::LocationEvent::log()
+{
+ std::string time_str = DebugUtils::humanReadableDateTime(timestamp, "%T", 9);
+#ifdef TIZEN_ENGINEER_MODE
+ _D("location lat=%.8f, lon=%.8f, acc=%.2f[m], time=%s, method=%d",
+ coordinates.latitude,
+ coordinates.longitude,
+ coordinates.accuracy,
+ time_str.c_str(),
+ method);
+#else /* TIZEN_ENGINEER_MODE */
+ _D("location lat=%.8f, lon=%.8f, acc=%.2f[m], time=%s",
+ coordinates.latitude,
+ coordinates.longitude,
+ coordinates.accuracy,
+ time_str.c_str());
+#endif /* TIZEN_ENGINEER_MODE */
+}
+
+void ctx::Visit::setLocation(Location location_)
+{
+ locationValid = true;
+ location = location_;
+}
+
+void ctx::Visit::printShort2Stream(std::ostream &out) const
+{
+ // print only valid visits
+ if (interval.end != 0) {
+ float duration = ((float) (interval.end - interval.start)) / 3600; // [h]
+ out << "__VISIT " << duration << "h: ";
+ out << DebugUtils::humanReadableDateTime(interval.start, "%m/%d %H:%M", 15) << " ÷ ";
+ out << DebugUtils::humanReadableDateTime(interval.end, "%m/%d %H:%M", 15) << std::endl;
+ }
+}
+
+bool ctx::operator==(const ctx::Visit &v1, const ctx::Visit &v2)
+{
+ return v1.interval.start == v2.interval.start
+ && v1.interval.end == v2.interval.end
+ && v1.categs == v2.categs
+ && v1.location.latitude == v2.location.latitude
+ && v1.location.longitude == v2.location.longitude
+ && v1.location.accuracy == v2.location.accuracy
+ && v1.locationValid == v2.locationValid
+ && v1.macSet == v2.macSet;
+}
+
+ctx::MacSet ctx::macSetFromString(const std::string &str)
+{
+ MacSet macSet;
+ std::stringstream ss;
+ ss << str;
+ ss >> macSet;
+ return macSet;
+}
+
+bool ctx::operator>(const Mac &m1, const Mac &m2)
+{
+ return m2 < m1;
+}
+
+std::shared_ptr<ctx::MacSet> ctx::macSetFromMacs2Counts(const Macs2Counts &macs2Counts)
+{
+ std::shared_ptr<MacSet> macSet(std::make_shared<MacSet>());
+ for (auto &macCount: macs2Counts) {
+ macSet->insert(macCount.first);
+ }
+ return macSet;
+}
+
+std::shared_ptr<ctx::MacSet> ctx::macSetsUnion(const std::vector<std::shared_ptr<MacSet>> &macSets)
+{
+ std::shared_ptr<MacSet> unionSet = std::make_shared<MacSet>();
+ for (std::shared_ptr<MacSet> macSet : macSets) {
+ unionSet->insert(macSet->begin(), macSet->end());
+ }
+ return unionSet;
+}
+
+ctx::Interval::Interval(time_t start_, time_t end_) : start(start_), end(end_) {
+ if (end_ < start_)
+ _E("Negative interval, start=%d, end=%d", start_, end_);
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CONTEXT_PLACE_RECOGNITION_USER_PLACES_TYPES_H_
+#define _CONTEXT_PLACE_RECOGNITION_USER_PLACES_TYPES_H_
+
+#include <memory>
+#include <vector>
+#include <map>
+#include <unordered_map>
+#include <unordered_set>
+#include <string>
+#include <ctime>
+#include <MyPlaceTypes.h>
+
+// Database
+#define VISIT_TABLE "Log_Myplace_Visit"
+#define VISIT_COLUMN_START_TIME "start_time"
+#define VISIT_COLUMN_END_TIME "end_time"
+#define VISIT_COLUMN_WIFI_APS "wifi_aps"
+#define VISIT_COLUMN_CATEGORY "category"
+#ifdef TIZEN_ENGINEER_MODE
+#define VISIT_COLUMN_START_TIME_HUMAN "start_time_human" // only for debug: human readable time data:
+#define VISIT_COLUMN_END_TIME_HUMAN "end_time_human" // only for debug: human readable time data:
+#endif /* TIZEN_ENGINEER_MODE */
+#define VISIT_COLUMN_LOCATION_VALID "location_valid"
+#define VISIT_COLUMN_LOCATION_LATITUDE "location_latitude"
+#define VISIT_COLUMN_LOCATION_LONGITUDE "location_longitude"
+#define VISIT_COLUMN_LOCATION_ACCURACY "location_accuracy"
+#define VISIT_COLUMN_CATEG_HOME "categ_home"
+#define VISIT_COLUMN_CATEG_WORK "categ_work"
+#define VISIT_COLUMN_CATEG_OTHER "categ_other"
+
+#define WIFI_APS_MAP_TABLE "Log_Myplace_WifiAPsMap"
+#define WIFI_APS_MAP_COLUMN_MAC "mac"
+#define WIFI_APS_MAP_COLUMN_NETWORK_NAME "network_name"
+#define WIFI_APS_MAP_COLUMN_INSERT_TIME "insert_time"
+
+#define PLACE_TABLE "Log_Myplace_Place"
+#define PLACE_COLUMN_CATEG_ID "categ_id"
+#define PLACE_COLUMN_CATEG_CONFIDENCE "categ_confidence"
+#define PLACE_COLUMN_NAME "name"
+#define PLACE_COLUMN_LOCATION_VALID "location_valid"
+#define PLACE_COLUMN_LOCATION_LATITUDE "location_latitude"
+#define PLACE_COLUMN_LOCATION_LONGITUDE "location_longitude"
+#define PLACE_COLUMN_LOCATION_ACCURACY "location_accuracy"
+#define PLACE_COLUMN_WIFI_APS "wifi_aps"
+#define PLACE_COLUMN_CREATE_DATE "create_date"
+
+#define WIFI_TABLE "Log_Myplace_Wifi"
+#define WIFI_COLUMN_TIMESTAMP "timestamp"
+#define WIFI_COLUMN_BSSID "bssid"
+#define WIFI_COLUMN_ESSID "essid"
+
+#define LOCATION_TABLE "Log_Myplace_Location"
+#define LOCATION_COLUMN_LATITUDE "latitude"
+#define LOCATION_COLUMN_LONGITUDE "longitude"
+#define LOCATION_COLUMN_ACCURACY "accuracy"
+#define LOCATION_COLUMN_TIMESTAMP "timestamp"
+#ifdef TIZEN_ENGINEER_MODE
+#define LOCATION_COLUMN_TIMESTAMP_HUMAN "time_human" // only for debug: human readable time data:
+#define LOCATION_COLUMN_METHOD "method"
+#endif /* TIZEN_ENGINEER_MODE */
+
+#define MYPLACE_SETTINGS_TABLE "Myplace_Settings"
+#define MYPLACE_SETTINGS_COLUMN_KEY "key"
+#define MYPLACE_SETTINGS_COLUMN_VALUE "value"
+#define MYPLACE_SETTING_KEY_USER_CONSENT PLACE_DETECTION_REQUEST_CONSENT
+
+enum PlaceRecogMode {
+ PLACE_RECOG_HIGH_ACCURACY_MODE = 0,
+ PLACE_RECOG_LOW_POWER_MODE = 1
+};
+
+namespace ctx {
+
+ /*
+ * type for numerical computations
+ */
+ typedef double num_t;
+
+ /*
+ * mac address
+ */
+ class Mac {
+
+ public:
+ const static size_t MAC_SIZE = 6; // number of bytes for mac address.
+ unsigned char c[MAC_SIZE];
+
+ Mac() {};
+ Mac(const std::string &str);
+ Mac(const char *str);
+ operator std::string() const;
+
+ }; /* class Mac */
+
+ std::istream &operator>>(std::istream &input, ctx::Mac &mac);
+ std::ostream &operator<<(std::ostream &output, const ctx::Mac &mac);
+ bool operator==(const ctx::Mac &m1, const ctx::Mac &m2);
+ bool operator!=(const ctx::Mac &m1, const ctx::Mac &m2);
+ bool operator<(const ctx::Mac &m1, const ctx::Mac &m2);
+ bool operator>(const ctx::Mac &m1, const ctx::Mac &m2);
+
+} /* namespace ctx */
+
+namespace std {
+
+ template <> struct hash<ctx::Mac> {
+ size_t operator()(const ctx::Mac & m) const {
+ size_t h = 1;
+ for (size_t i = 0; i < ctx::Mac::MAC_SIZE; i++) {
+ h = h * 37 + m.c[i];
+ }
+ return h;
+ }
+ };
+
+} /* namespace std */
+
+namespace ctx {
+
+ typedef float share_t;
+ typedef int count_t;
+
+ typedef std::unordered_map<ctx::Mac, ctx::count_t> Macs2Counts;
+ typedef std::unordered_map<ctx::Mac, ctx::share_t> Macs2Shares;
+
+ typedef std::unordered_set<ctx::Mac> MacSet;
+
+ std::istream &operator>>(std::istream &input, ctx::MacSet &macSet);
+ std::ostream &operator<<(std::ostream &output, const ctx::MacSet &macSet);
+ ctx::MacSet macSetFromString(const std::string &str);
+
+ std::shared_ptr<MacSet> macSetsUnion(const std::vector<std::shared_ptr<MacSet>> &macSets);
+
+ struct Interval {
+ time_t start;
+ time_t end;
+
+ Interval(time_t start, time_t end);
+ };
+
+} /* namespace ctx */
+
+namespace std {
+
+ template <> struct hash<ctx::Interval> {
+ size_t operator()(const ctx::Interval & interval) const {
+ return interval.end * interval.start;
+ }
+ };
+
+} /* namespace std */
+
+namespace ctx {
+
+ /*
+ * fully describes interval data after the interval is finished
+ */
+ struct Frame {
+ Interval interval;
+ count_t numberOfTimestamps;
+ Macs2Counts macs2Counts;
+
+ Frame(Interval interval_) : interval(interval_), numberOfTimestamps(0) {};
+ };
+
+ /*
+ * mac address + its timestamp
+ */
+ struct MacEvent {
+ time_t timestamp;
+ Mac mac;
+ std::string networkName;
+
+ MacEvent(time_t timestamp_, Mac mac_, std::string networkName_ = "")
+ : timestamp(timestamp_)
+ , mac(mac_)
+ , networkName(networkName_) {}
+ };
+
+ typedef std::map<int, num_t> Categs; // scores of categories
+
+#ifdef TIZEN_ENGINEER_MODE
+ enum LocationSource {
+ LOCATION_METHOD_REQUEST = 0,
+ LOCATION_METHOD_GET_LOCATION = 1,
+ LOCATION_METHOD_GET_LAST_LOCATION = 2
+ };
+#endif /* TIZEN_ENGINEER_MODE */
+
+ /*
+ * location + timestamp + method
+ */
+ struct LocationEvent {
+ Location coordinates;
+ time_t timestamp;
+
+#ifdef TIZEN_ENGINEER_MODE
+ LocationSource method;
+
+ LocationEvent(double latitude_, double longitude_, double accuracy_, time_t timestamp_, LocationSource method_) :
+ coordinates(latitude_, longitude_, accuracy_),
+ timestamp(timestamp_), method(method_) {}
+#else /* TIZEN_ENGINEER_MODE */
+ LocationEvent(double latitude_, double longitude_, double accuracy_, time_t timestamp_) :
+ coordinates(latitude_, longitude_, accuracy_),
+ timestamp(timestamp_) {}
+#endif /* TIZEN_ENGINEER_MODE */
+
+ void log();
+
+ }; /* struct LocationEvent */
+
+ struct Visit {
+ Interval interval;
+ std::shared_ptr<MacSet> macSet;
+ Categs categs;
+ bool locationValid;
+ Location location; // makes sense if locationValid == true;
+
+ Visit(Interval interval_, std::shared_ptr<MacSet> macSet_ = std::make_shared<MacSet>(), Categs categs_ = Categs()) :
+ interval(interval_),
+ macSet(macSet_),
+ categs(categs_),
+ locationValid(false) {}
+ void setLocation(Location location);
+ void printShort2Stream(std::ostream &out) const;
+
+ }; /* struct Visit */
+
+ bool operator==(const Visit &v1, const Visit &v2);
+ typedef std::vector<Visit> Visits;
+ typedef std::vector<MacEvent> MacEvents; // used to store current interval logs
+
+ std::shared_ptr<MacSet> macSetFromMacs2Counts(const Macs2Counts &macs2Counts);
+
+} /* namespace ctx */
+
+#endif /* End of _CONTEXT_PLACE_RECOGNITION_USER_PLACES_TYPES_H_ */
SET(target "${target_prefix}-my-place-visit-categer")
+INCLUDE_DIRECTORIES(../utils)
+
FILE(GLOB SRCS *.cpp)
ADD_LIBRARY(${target} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${target} ${target_myplace_utils_static})
INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}/${target_dir})
\ No newline at end of file
#define _CONTEXT_PLACE_RECOGNITION_MAHAL_H_
#include <vector>
-#include "../facade/UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
namespace ctx {
#ifndef _CONTEXT_PLACE_RECOGNITION_PIECEWISE_LIN_
#define _CONTEXT_PLACE_RECOGNITION_PIECEWISE_LIN_
-#include "../facade/UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
namespace ctx {
#ifndef _CONTEXT_PLACE_RECOGNITION_VISIT_CATEGER_H_
#define _CONTEXT_PLACE_RECOGNITION_VISIT_CATEGER_H_
-#include "../facade/UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
#include "Mahal.h"
#include "PiecewiseLin.h"
#include <map>
#ifndef _CONTEXT_PLACE_RECOGNITION_LOCATION_LISTENER_IFACE_H_
#define _CONTEXT_PLACE_RECOGNITION_LOCATION_LISTENER_IFACE_H_
-#include "../facade/UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
namespace ctx {
#include <Types.h>
#include <Json.h>
#include <DatabaseManager.h>
-#include "../facade/UserPlacesTypes.h"
-#include "../facade/UserPlacesParams.h"
-#include "../utils/DebugUtils.h"
+#include <UserPlacesTypes.h>
+#include <UserPlacesParams.h>
+#include <DebugUtils.h>
#include "LocationLogger.h"
#ifdef TIZEN_ENGINEER_MODE
#include <sstream>
#include <Types.h>
#include <Json.h>
-#include "../facade/UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
#include "VisitDetector.h"
-#include "../facade/UserPlacesParams.h"
-#include "../utils/Similarity.h"
-#include "../utils/Median.h"
-#include "../utils/DebugUtils.h"
+#include <UserPlacesParams.h>
+#include <Similarity.h>
+#include <Median.h>
+#include <DebugUtils.h>
#include <gmodule.h>
#include <DatabaseManager.h>
#include <map>
#include <unordered_map>
#include <unordered_set>
-#include "../facade/UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
#include <Json.h>
#include "VisitListenerIface.h"
#include "LocationLogger.h"
#ifndef _CONTEXT_PLACE_RECOGNITION_WIFI_LISTENER_IFACE_H_
#define _CONTEXT_PLACE_RECOGNITION_WIFI_LISTENER_IFACE_H_
-#include "../facade/UserPlacesTypes.h"
+#include <UserPlacesTypes.h>
namespace ctx {
#include <sstream>
#include <Types.h>
#include <DatabaseManager.h>
-#include "../facade/UserPlacesTypes.h"
-#include "../utils/DebugUtils.h"
+#include <UserPlacesTypes.h>
+#include <DebugUtils.h>
#include "WifiLogger.h"
#define __WIFI_CREATE_TABLE_COLUMNS \
#include <TimerManager.h>
#include "WifiListenerIface.h"
#include "VisitListenerIface.h"
-#include "../facade/UserPlacesParams.h"
+#include <UserPlacesParams.h>
/* Database usage flag */
#define WIFI_LOGGER_DATABASE false