![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
The log-driven half of SolverJMT: linkAndLog, parseLogs, parseTranState, parseTranRespT, sampleAggr, sampleSysAggr, getProbAggr, getProbSysAggr, getCdfRespT and getTranProbAggr. More...
#include <algorithm>#include <cmath>#include <limits>#include <cstdlib>#include <fstream>#include <map>#include <set>#include <sstream>#include <string>#include <vector>#include "line/api/sn/sn_state.h"#include "line/lang/qn/network_struct.h"#include "line/solvers/wrappers/jmt/solver_jmt.h"#include "line/util/error.h"#include "line/util/tempdir.h"Go to the source code of this file.
Classes | |
| struct | line::jmt::JmtEvent |
| One logged event: when, of which kind, in which class, for which job. More... | |
| struct | line::jmt::JmtLogFile |
| One arrival or departure CSV file, as three parallel columns. More... | |
| struct | line::jmt::JmtNodeTrace< T > |
| The per-class queue-length trajectory of one node, plus its event stream. More... | |
| struct | line::jmt::JmtSysTrace< T > |
| The system trajectory: one per-class block per station, on a common grid. More... | |
| struct | line::jmt::JmtProbAggr |
| What jmt_prob_aggr reports: the system probability and the per-station ones. More... | |
| struct | line::jmt::JmtReplication< T > |
| Transient averages over independent replications, on one time grid. More... | |
Namespaces | |
| namespace | line |
| namespace | line::jmt |
Enumerations | |
| enum class | line::jmt::JmtEventType { line::jmt::INIT , line::jmt::ARV , line::jmt::DEP } |
| The event kinds a JMT log carries, MATLAB EventType. More... | |
Functions | |
| template<class T> | |
| qn::NetworkStruct< T > | line::jmt::jmt_link_and_log (const qn::NetworkStruct< T > &sn, const std::vector< bool > &is_node_logged, const std::string &log_path) |
| Port of @@MNetwork/linkAndLog.m: the model with an arrival and a departure Logger around every logged node. | |
| JmtLogFile | line::jmt::jmt_read_log (const std::string &path) |
| Read one JMT log CSV. | |
| template<class T> | |
| JmtNodeTrace< T > | line::jmt::jmt_parse_tran_state (const JmtLogFile &arv, const JmtLogFile &dep, const std::vector< std::size_t > &class_of_arv, const std::vector< std::size_t > &class_of_dep, const std::vector< double > &node_preload) |
| Port of parseTranState: the arrival and departure logs merged into a per-class queue-length trajectory. | |
| std::map< std::size_t, std::vector< double > > | line::jmt::jmt_parse_tran_resp_t (const JmtLogFile &arv, const JmtLogFile &dep, const std::vector< std::size_t > &class_of_arv, const std::vector< std::size_t > &class_of_dep) |
| Port of parseTranRespT: the per-class response-time samples of one node. | |
| template<class T> | |
| std::map< std::size_t, JmtNodeTrace< T > > | line::jmt::jmt_parse_logs (const qn::NetworkStruct< T > &orig, const std::vector< bool > &is_node_logged, const std::string &log_path) |
| Port of parseLogs: read every logged node's CSV pair. | |
| template<class T> | |
| JmtNodeTrace< T > | line::jmt::jmt_sample_aggr (const qn::NetworkStruct< T > &sn, std::size_t node, std::size_t num_events, const JmtOptions &opt) |
| Port of sampleAggr: the queue-length trajectory of one node. | |
| template<class T> | |
| JmtSysTrace< T > | line::jmt::jmt_sample_sys_aggr (const qn::NetworkStruct< T > &sn, std::size_t num_events, const JmtOptions &opt) |
| Port of sampleSysAggr: every station's trajectory on one time grid. | |
| template<class T> | |
| std::map< std::pair< std::size_t, std::size_t >, std::vector< std::pair< double, double > > > | line::jmt::jmt_get_cdf_resp_t (const qn::NetworkStruct< T > &sn, const JmtOptions &opt, bool seed_from_steady=true) |
| Port of getCdfRespT: the empirical response-time distribution per (station, class), as the (F, X) pairs ecdf returns. | |
| template<class T> | |
| std::pair< std::vector< double >, std::vector< std::vector< double > > > | line::jmt::jmt_get_tran_prob_aggr (const qn::NetworkStruct< T > &sn, std::size_t station, std::size_t replications, const JmtOptions &opt, std::vector< std::vector< double > > &states_out) |
| Port of getTranProbAggr: the transient distribution of one station's aggregate state, estimated over replications independent runs. | |
| std::vector< double > | line::jmt::jmt_dwell_weights (const std::vector< double > &t) |
| The dwell-time weights of a trajectory sampled at t. | |
| template<class T> | |
| JmtProbAggr | line::jmt::jmt_prob_aggr (const qn::NetworkStruct< T > &sn, const JmtOptions &opt, std::size_t target_station=0, const std::vector< double > &target=std::vector< double >()) |
| Port of getProbAggr and getProbSysAggr, both off ONE instrumented run. | |
| template<class T> | |
| JmtReplication< T > | line::jmt::jmt_replication (const qn::NetworkStruct< T > &sn, const JmtOptions &opt) |
| Port of the replication method of @@SolverJMT/runAnalyzer.m. | |
The log-driven half of SolverJMT: linkAndLog, parseLogs, parseTranState, parseTranRespT, sampleAggr, sampleSysAggr, getProbAggr, getProbSysAggr, getCdfRespT and getTranProbAggr.
WHY THERE IS A SECOND MODEL. JMT reports MEANS, not trajectories; everything here recovers a trajectory instead, by rebuilding the model with a Logger on each side of every node of interest, running the simulation, and reading the arrival and departure CSV files back. jmt_link_and_log is that rebuild, and it is the port of @@MNetwork/linkAndLog.m: a job entering node i now crosses Arv_i first and leaves through Dep_i, so the two files bracket every passage through i.
THE LOGGERS CHANGE THE TOPOLOGY, NOT THE MODEL. They hold no jobs and route with probability one, so the stochastic complement that removes a Router removes them too and the stationary law is unchanged; what they add is the event stream. That is why the sample path this returns is the sample path of the original model and not of an instrumented approximation of it.
THE TARGET STATE NOW TRAVELS. getProbAggr and getProbSysAggr weigh the trajectory against sn.state{isf}, the model's CURRENT state, and this header used to refuse both because qn::NetworkStruct carried no such thing. It does now: every writer emits the (stateSpace, statePrior) pair for each stateful node that carries a state – which is what setState and initFromMarginal leave – and sn_declared_marginal decodes that pair back into the per-class job counts the two getters compare against, falling back per station to the default marking where nothing was declared.
Definition in file jmt_logs.h.