9 #ifndef FMM_STMATCH_ALGORITHM_HPP
10 #define FMM_STMATCH_ALGORITHM_HPP
12 #include "network/network.hpp"
13 #include "network/network_graph.hpp"
14 #include "mm/composite_graph.hpp"
15 #include "mm/transition_graph.hpp"
16 #include "mm/mm_type.hpp"
17 #include "python/pyfmm.hpp"
20 #include <boost/property_tree/ptree.hpp>
21 #include <boost/property_tree/xml_parser.hpp>
23 #include "cxxopts/cxxopts.hpp"
42 STMATCHConfig(
int k_arg = 8,
double r_arg = 300,
double gps_error_arg = 50,
43 double vmax_arg = 30,
double factor_arg = 1.5);
62 const boost::property_tree::ptree &xml_data);
67 const cxxopts::ParseResult &arg_data);
79 network_(network), graph_(graph) {
138 const std::vector<NETWORK::NodeIndex> &targets,
double delta);
Transition graph class in HMM.
double factor
factor multiplied to vmax*deltaT to limit the search of shortest path
static STMATCHConfig load_from_arg(const cxxopts::ParseResult &arg_data)
Load from argument parsed data.
std::vector< const TGNode * > TGOpath
The optimal path of nodes in the transition graph.
double vmax
maximum speed of the vehicle, unit is map_unit/second
STMATCH(const NETWORK::Network &network, const NETWORK::NetworkGraph &graph)
Create a stmatch model from network and graph.
Map matched result representation.
double gps_error
GPS error, unit is map_unit.
std::vector< double > shortest_path_upperbound(int level, const CompositeGraph &cg, NETWORK::NodeIndex source, const std::vector< NETWORK::NodeIndex > &targets, double delta)
Return distances from source to all targets and with an upper bound of delta to stop the search.
double radius
search radius for candidates, unit is map_unit
POD Match result type used in Python API.
std::vector< FMM::NETWORK::EdgeID > C_Path
Complete path, ids of a sequence of topologically connected edges.
void print() const
Print configuration data.
static STMATCHConfig load_from_xml(const boost::property_tree::ptree &xml_data)
Load from xml data.
Graph class of the network.
void update_tg(TransitionGraph *tg, const CompositeGraph &cg, const CORE::Trajectory &traj, const STMATCHConfig &config)
Update probabilities in a transition graph.
void update_layer(int level, TGLayer *la_ptr, TGLayer *lb_ptr, const CompositeGraph &cg, double eu_dist, double delta)
Update probabilities between two layers a and b in the transition graph.
Composite Graph as a wrapper of network graph and dummy graph.
Configuration of stmatch algorithm.
C_Path build_cpath(const TGOpath &tg_opath, std::vector< int > *indices)
Create a topologically connected path according to each matched candidate.
unsigned int NodeIndex
Node Index in the network, range from [0,num_vertices-1 ].
PYTHON::PyMatchResult match_wkt(const std::string &wkt, const STMATCHConfig &config)
Match a wkt linestring to the road network.
MatchResult match_traj(const CORE::Trajectory &traj, const STMATCHConfig &config)
Match a trajectory to the road network.
std::vector< TGNode > TGLayer
A layer of nodes in the transition graph.
int k
number of candidates
bool validate() const
Check the validity of the configuration.
STMATCHConfig(int k_arg=8, double r_arg=300, double gps_error_arg=50, double vmax_arg=30, double factor_arg=1.5)
Constructor of stmatch algorithm configuration.