![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Classes | |
| struct | JmtEvent |
| One logged event: when, of which kind, in which class, for which job. More... | |
| struct | JmtLogFile |
| One arrival or departure CSV file, as three parallel columns. More... | |
| struct | JmtMeasure |
| One <measure> of a JMT result document, by its attributes. More... | |
| struct | JmtNodeTrace |
| The per-class queue-length trajectory of one node, plus its event stream. More... | |
| struct | JmtOptions |
| The options of one JMT solve, SolverOptions('JMT') restricted to what is read. More... | |
| struct | JmtProbAggr |
| What jmt_prob_aggr reports: the system probability and the per-station ones. More... | |
| struct | JmtReplication |
| Transient averages over independent replications, on one time grid. More... | |
| struct | JmtResult |
| The result of a JMT solve: the shared AvgResult plus what only JMT reports. More... | |
| struct | JmtSysTrace |
| The system trajectory: one per-class block per station, on a common grid. More... | |
Enumerations | |
| enum class | JmtEventType { INIT , ARV , DEP } |
| The event kinds a JMT log carries, MATLAB EventType. More... | |
Functions | |
| template<class T> | |
| qn::NetworkStruct< T > | 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 | jmt_read_log (const std::string &path) |
| Read one JMT log CSV. | |
| template<class T> | |
| JmtNodeTrace< T > | 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 > > | 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 > > | 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 > | 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 > | 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 > > > | 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 > > > | 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 > | jmt_dwell_weights (const std::vector< double > &t) |
| The dwell-time weights of a trajectory sampled at t. | |
| template<class T> | |
| JmtProbAggr | 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 > | jmt_replication (const qn::NetworkStruct< T > &sn, const JmtOptions &opt) |
| Port of the replication method of @@SolverJMT/runAnalyzer.m. | |
| util::ProcResult | jmt_run_docker (const std::string &image, const std::string &mode, const std::string &model_path, long seed, const JmtOptions &opt) |
| Run the analysis inside the JMT container and copy the result back beside the model, so the caller sees the layout a local JVM would have produced. | |
| const char * | jmt_result_ext (const std::string &mode) |
| The suffix jmt.commandline.Jmt appends to the model path, per mode. | |
| bool | jmt_available () |
| True when a local JVM and common/JMT.jar are both present. | |
| util::ProcResult | jmt_solve_rest (const std::string &rest_url, const std::string &mode, const std::string &model_path, long seed, const JmtOptions &opt) |
| Port of jmtSolveRest: POST the model document, write the result document back beside the model so the local parsers are unaffected. | |
| util::ProcResult | jmt_run (const std::string &mode, const std::string &model_path, long seed, const JmtOptions &opt) |
| Port of jmtRun: one batch analysis, leaving the result where the JMT CLI itself would leave it. | |
| std::vector< JmtMeasure > | jmt_parse_measures (const std::string &result_path, const std::string &command_output) |
| Port of getResultsJSIM: every <measure> of the result document. | |
| template<class T> | |
| JmtResult< T > | jmt_map_measures (const qn::NetworkStruct< T > &sn, const std::vector< JmtMeasure > &measures, bool confint) |
| Port of getResults.m: the measures mapped onto the metric matrices. | |
| template<class T> | |
| void | jmt_region_losses (const qn::NetworkStruct< T > &sn, JmtResult< T > &res) |
| The region loss table, port of the sn.nregions > 0 tail of getResults.m. | |
| template<class T> | |
| JmtResult< T > | jmt_parse_jmva (const qn::NetworkStruct< T > &sn, const std::string &result_path, const std::string &command_output) |
| Port of getResultsJMVA.m: the per-CHAIN answer spread back over the classes. | |
| std::vector< std::string > | jmt_list_valid_methods () |
| Port of SolverJMT.listValidMethods. | |
| template<class T> | |
| std::string | jmt_method_refusal (const qn::NetworkStruct< T > &sn, const std::string &method, const JmtOptions &opt) |
| The structural half of SolverJMT's method gate; empty when admissible. | |
| template<class T> | |
| JmtResult< T > | solver_jmt_run_analyzer (const qn::NetworkStruct< T > &sn, const JmtOptions &opt_in) |
| Port of @@SolverJMT/runAnalyzer.m, the jsim and jmva arms. | |
Variables | |
| static const char * | JMT_DOCKER_IMAGE = "imperialqore/jmt-rest:latest" |
| The default JMT REST/Docker image, MATLAB's jmtDockerImage candidate. | |
|
strong |
The event kinds a JMT log carries, MATLAB EventType.
| Enumerator | |
|---|---|
| INIT | |
| ARV | |
| DEP | |
Definition at line 60 of file jmt_logs.h.
|
inline |
True when a local JVM and common/JMT.jar are both present.
Definition at line 285 of file solver_jmt.h.
References jmt_available().
Referenced by jmt_available().
|
inline |
The dwell-time weights of a trajectory sampled at t.
The reference writes dt = [diff(t); 0]: a state observed at t_k is held until t_{k+1}, and the LAST sample carries no weight because the run ends there and how long it would have been held is not observed. Dropping the trailing zero instead – weighting the last sample by the previous gap – adds a dwell that was never measured, which is why it is kept as a zero.
Definition at line 740 of file jmt_logs.h.
References jmt_dwell_weights().
Referenced by jmt_dwell_weights(), and jmt_prob_aggr().
| 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.
Every station with a service process is logged, the model is simulated, and each node's passages are turned into samples. With seed_from_steady (the getCdfRespT contract) the model is FIRST solved for its steady-state queue lengths and the logged run starts preloaded at their rounded values, the closed-class remainder on the bottleneck – the reference's two-run pipeline, which shortens the warmup and is what makes the seeded curve comparable to MATLAB's for the same seed. Without it (the getTranCdfRespT contract) the logged run starts from the model's default initial state, so the samples cover the transient.
Definition at line 567 of file jmt_logs.h.
References line::jmt::JmtResult< T >::avg, line::jmt::JmtLogFile::cls, line::qn::NetworkStruct< T >::initmarking, line::io::jmt_cache_classes(), jmt_get_cdf_resp_t(), jmt_link_and_log(), line::io::jmt_metric_enabled(), jmt_parse_tran_resp_t(), jmt_read_log(), line::lang::Join, line::util::TempDir::keep(), line::qn::NetworkStruct< T >::nodes, line::qn::NetworkStruct< T >::nstations, line::util::TempDir::path(), line::io::RespT, solver_jmt_run_analyzer(), line::lang::Source, and line::qn::NetworkStruct< T >::station_to_node.
Referenced by jmt_get_cdf_resp_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.
Each run is a fresh seed, seed + it, and the runs are resampled onto the union of their event times before being counted, so a state's probability at time t is the fraction of replications occupying it at t. A FINITE HORIZON IS REQUIRED: with an unbounded one every replication ends at a different time and the union grid is not a grid the estimate is defined on – which is exactly the error the reference raises.
Definition at line 675 of file jmt_logs.h.
References line::Matrix< T >::empty(), line::InputError::InputError(), jmt_get_tran_prob_aggr(), jmt_sample_sys_aggr(), line::jmt::JmtOptions::seed, line::Matrix< T >::size(), and line::lang::Source.
Referenced by jmt_get_tran_prob_aggr().
| 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.
| sn | the model to instrument |
| is_node_logged | (nnodes) which nodes get the Logger pair |
| log_path | the directory the CSV files are written to |
The new node order is the reference's: the original nodes, then the arrival Loggers in node order, then the departure Loggers. A SOURCE AND A SINK ARE NEVER LOGGED – an arrival Logger before a Source has nothing to observe and a departure Logger after a Sink is unreachable – and the reference drops them from the request with a warning; this port drops them silently, since the caller's is_node_logged is derived from the metric handles and never asks for either on purpose.
Definition at line 88 of file jmt_logs.h.
References line::qn::NetworkStruct< T >::add_node(), line::Matrix< T >::cols(), line::InputError::InputError(), jmt_link_and_log(), line::qn::NetworkStruct< T >::log_path, line::lang::Logger, line::qn::NetworkStruct< T >::nodes, line::qn::NetworkStruct< T >::P, line::qn::NetworkStruct< T >::Peff, line::lang::PROB, line::qn::NetworkStruct< T >::refresh_struct(), line::Matrix< T >::rows(), line::qn::NetworkStruct< T >::set_route(), line::lang::Sink, and line::lang::Source.
Referenced by jmt_get_cdf_resp_t(), jmt_link_and_log(), jmt_sample_aggr(), and jmt_sample_sys_aggr().
|
inline |
Port of SolverJMT.listValidMethods.
replication is the reference's own TRANSIENT route: a single sample path is not the transient mean E[N](t), there being no time-ergodicity at a fixed t, so it averages sampleSysAggr over iter_max seeds. It is composed from jmt_sample_sys_aggr in jmt_logs.h (jmt_replication) rather than from solver_jmt_run_analyzer, which is why it is not an arm of the dispatch below.
Definition at line 838 of file solver_jmt.h.
References jmt_list_valid_methods().
Referenced by line::autosolver::auto_family_methods(), jmt_list_valid_methods(), line::NetworkSolver::list_valid_methods(), and solver_jmt_run_analyzer().
| JmtResult< T > line::jmt::jmt_map_measures | ( | const qn::NetworkStruct< T > & | sn, |
| const std::vector< JmtMeasure > & | measures, | ||
| bool | confint ) |
Port of getResults.m: the measures mapped onto the metric matrices.
THE RECURRENCE TEST IS WHY analyzedSamples IS READ. For a CLOSED class JMT may terminate a measure before it has seen more samples than there are jobs in the chain, and such a measure is not an estimate of anything; the reference zeroes it rather than reporting it, and so does this. An OPEN class has no such bound and is taken as reported.
Definition at line 520 of file solver_jmt.h.
References line::jmt::JmtResult< T >::ACI, line::jmt::JmtMeasure::analyzed_samples, line::jmt::JmtResult< T >::avg, line::lang::Cache, line::jmt::JmtResult< T >::cache_hit_prob, line::jmt::JmtMeasure::has_bounds, jmt_map_measures(), line::jmt::JmtMeasure::job_class, line::jmt::JmtMeasure::lower, line::Matrix< T >::Matrix(), line::jmt::JmtMeasure::mean, line::jmt::JmtMeasure::measure_type, line::jmt::JmtResult< T >::MemOcc, line::jmt::JmtMeasure::node_type, line::jmt::JmtResult< T >::QCI, line::jmt::JmtResult< T >::RCI, line::jmt::JmtMeasure::station, line::jmt::JmtResult< T >::TCI, line::jmt::JmtResult< T >::UCI, line::jmt::JmtMeasure::upper, and line::jmt::JmtResult< T >::Weight.
Referenced by jmt_map_measures(), and solver_jmt_run_analyzer().
| std::string line::jmt::jmt_method_refusal | ( | const qn::NetworkStruct< T > & | sn, |
| const std::string & | method, | ||
| const JmtOptions & | opt ) |
The structural half of SolverJMT's method gate; empty when admissible.
THE RULES A FLAT FEATURE SET CANNOT STATE, and each is named rather than reported as a bare no: the transient horizon 'replication' averages iter_max sample paths over [0,T]; a mean at an unstated horizon is not a quantity, and the horizon is an OPTION rather than a model feature. a single-server station the eight closed-form JMVA algorithms are single-server only, which is why write_jmva refuses the model rather than emitting an <ldstation> the algorithm cannot read. A server count has no feature name; the load-dependent half of the same restriction DOES, and rides in jmt_feature_set as an unset LoadDependence. the load-dependent shape JMT carries a scaling only as a server count, so alpha(n) = min(n,c) is written exactly and nothing else is.
ONE PREDICATE, TWO CALLERS: solver_jmt_run_analyzer raises it, so a caller naming the method by hand gets the sentence rather than a JMT stack trace, and autosolver::auto_family_refusal returns it, so findSolver never offers the pair. A second copy of any rule is how the gate and the run drift apart.
Definition at line 870 of file solver_jmt.h.
References line::io::jmt_buffer_capacity_refusal(), jmt_method_refusal(), line::qn::jmva_is_closed_only(), and line::qn::GlobalConstants::Zero.
Referenced by line::autosolver::auto_family_refusal(), jmt_method_refusal(), jmt_replication(), and solver_jmt_run_analyzer().
| JmtResult< T > line::jmt::jmt_parse_jmva | ( | const qn::NetworkStruct< T > & | sn, |
| const std::string & | result_path, | ||
| const std::string & | command_output ) |
Port of getResultsJMVA.m: the per-CHAIN answer spread back over the classes.
JMVA answers per chain, and each measure is converted to a per-class one by the class's share of its chain at that station: alpha(i,k) weighted by the ratio of the class service time to the chain's. The conversions are the reference's, measure by measure, and the two that are not a bare share are the reason this cannot be a generic rescale: Utilization is divided by the chain's visits at the REFERENCE station and, at a multiserver station, scaled by min(N, c)/c. Residence time is JMVA's per-CHAIN residence and is converted to LINE's response time per visit by dividing by the class visits.
THE STATION IS RESOLVED BY NAME, not by the position of the stationresults block. The reference indexes sn.nservers, ST and sn.visits with the BLOCK index, but the blocks exclude the Source while those tables do not, so on any open model every station's demand is read one row early. Reading the station attribute is the same lookup on a closed model and the correct one on an open model.
Definition at line 717 of file solver_jmt.h.
References line::mva::ChainDemands< T >::alpha, line::jmt::JmtResult< T >::avg, jmt_parse_jmva(), line::jmt::JmtResult< T >::log_norm_const, line::Matrix< T >::Matrix(), line::NumericError::NumericError(), line::xml::parse_file(), line::mva::ChainDemands< T >::refstatchain, line::mva::sn_get_demands_chain(), line::mva::ChainDemands< T >::ST, line::mva::ChainDemands< T >::STchain, and line::mva::ChainDemands< T >::Vchain.
Referenced by jmt_parse_jmva(), and solver_jmt_run_analyzer().
| 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.
| orig | the original struct, whose node names the files are keyed by |
| is_node_logged | (nnodes) which nodes carry a Logger pair |
| log_path | where the loggers wrote |
The preload of a node is its initial_marginal, the same value the JSIM preload block carried, because the logs record only the CROSSINGS: a job that was already at the node when the run started never arrives, so without the preload the cumulative sum starts from zero and every count is short by the initial population.
Definition at line 399 of file jmt_logs.h.
References line::qn::NetworkStruct< T >::classes, line::jmt::JmtLogFile::cls, line::qn::NetworkStruct< T >::initmarking, jmt_parse_logs(), jmt_parse_tran_state(), jmt_read_log(), line::qn::NetworkStruct< T >::nclasses, and line::qn::NetworkStruct< T >::nodes.
Referenced by jmt_parse_logs(), jmt_sample_aggr(), and jmt_sample_sys_aggr().
|
inline |
Port of getResultsJSIM: every <measure> of the result document.
A MISSING FILE IS A FAILED SIMULATION, not an empty result: JMT writes the document even when every measure is unsuccessful, so its absence means the run itself did not complete, and returning zeros would report a solved model.
Definition at line 453 of file solver_jmt.h.
References line::jmt::JmtMeasure::analyzed_samples, line::xml::Element::attr(), line::xml::Element::has_attr(), line::jmt::JmtMeasure::has_bounds, jmt_parse_measures(), line::jmt::JmtMeasure::job_class, line::jmt::JmtMeasure::lower, line::jmt::JmtMeasure::mean, line::jmt::JmtMeasure::measure_type, line::jmt::JmtMeasure::node_type, line::NumericError::NumericError(), line::xml::parse_file(), line::jmt::JmtMeasure::station, line::jmt::JmtMeasure::successful, and line::jmt::JmtMeasure::upper.
Referenced by jmt_parse_measures(), and solver_jmt_run_analyzer().
|
inline |
Port of parseTranRespT: the per-class response-time samples of one node.
A job's passages are recovered by pairing its events IN TIME ORDER: the first arrival, the matching departure, and so on. A job may pass through the same node several times – a closed model does nothing else – so the pairing is over the whole per-job sequence and not just its first and last event, and an unmatched trailing arrival (the job was still there when the run ended, or it was dropped) is discarded rather than paired with the run's end.
Definition at line 345 of file jmt_logs.h.
References jmt_parse_tran_resp_t(), line::jmt::JmtLogFile::job, and line::jmt::JmtLogFile::ts.
Referenced by jmt_get_cdf_resp_t(), and jmt_parse_tran_resp_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.
SIMULTANEOUS EVENTS ARE REORDERED, which is the whole reason this is not a merge sort. Two events at the same timestamp involving the SAME job are a pass-through – the job arrives and departs with no time in between – and JMT writes them in file order, not in causal order. When the previous event of that job was of the same kind, the reference swaps the event with the next one involving the job, which restores the alternation; without it the cumulative sum below goes negative and the trajectory reports a queue with -1 jobs in it.
Definition at line 247 of file jmt_logs.h.
References ARV, line::jmt::JmtEvent::cls, DEP, line::jmt::JmtNodeTrace< T >::event, INIT, jmt_parse_tran_state(), line::jmt::JmtEvent::job, line::jmt::JmtLogFile::job, line::jmt::JmtNodeTrace< T >::qlen, line::jmt::JmtEvent::t, line::jmt::JmtNodeTrace< T >::t, line::jmt::JmtLogFile::ts, and line::jmt::JmtEvent::type.
Referenced by jmt_parse_logs(), and jmt_parse_tran_state().
| 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.
THEY ARE TIME AVERAGES, NOT SAMPLE FRACTIONS. The trajectory is event-driven, so its samples are not equally spaced; counting them would weigh a state the network leaves at once as heavily as one it sits in. Each sample is weighed by the interval it is held for, which is what makes the estimate converge to the stationary probability.
ONE RUN, NOT ONE PER QUESTION. The reference instruments one node at a time (sampleAggr logs the node it was asked about) and therefore simulates again for every station; jmt_sample_sys_aggr already logs every station on a common grid, so the station marginals are read off the same sample path as the joint probability. That is a DIFFERENT estimator from the reference's – same quantity, one sample path instead of M independent ones – and it is the cheaper and the more consistent of the two, since the marginals it reports cannot contradict the joint they were taken from.
target OVERRIDES THE DECLARED STATE of one station where it is given, which is getProbAggr's second argument; every other station keeps the row setState/initFromMarginal left, exactly as the reference substitutes into sn.state{isf} and leaves the rest alone.
A STATE NEVER SEEN IS 0 AND IS REPORTED AS SUCH, with seen false beside it. The reference warns and returns zero rather than erroring, because on a simulation a state of small probability legitimately fails to appear in a finite run: that is a statement about the run length, and the caller is the one who can lengthen it.
Definition at line 784 of file jmt_logs.h.
References line::InputError::InputError(), jmt_dwell_weights(), jmt_prob_aggr(), jmt_sample_sys_aggr(), line::NumericError::NumericError(), line::Matrix< T >::size(), line::api::sn_declared_marginal(), line::lang::Source, line::jmt::JmtProbAggr::station, line::jmt::JmtProbAggr::station_seen, line::jmt::JmtProbAggr::sys, and line::jmt::JmtProbAggr::sys_seen.
Referenced by jmt_prob_aggr().
|
inline |
Read one JMT log CSV.
THE COLUMN LAYOUT IS THE REFERENCE'S, not inferred from the header: the loggers this port installs carry the default flag set of Logger.m (timestamp, job id and job class on; wall-clock start time, logger name and the two inter-departure columns off), and parseLogs.m reads columns 2, 3 and 4 of a six-column line after one header row. Sniffing the header instead would silently accept a file written with other flags and read the wrong column as the timestamp.
Definition at line 204 of file jmt_logs.h.
References line::jmt::JmtLogFile::cls, line::InputError::InputError(), jmt_read_log(), line::jmt::JmtLogFile::job, line::Matrix< T >::size(), and line::jmt::JmtLogFile::ts.
Referenced by jmt_get_cdf_resp_t(), jmt_parse_logs(), and jmt_read_log().
| void line::jmt::jmt_region_losses | ( | const qn::NetworkStruct< T > & | sn, |
| JmtResult< T > & | res ) |
The region loss table, port of the sn.nregions > 0 tail of getResults.m.
JMT EXPOSES NO REGION DROP MEASURE, and its region throughput is the CARRIED (admitted) rate, so the offered rate is reconstructed by flow balance: the rate at which stations outside the region route jobs across its boundary, which the drop does not affect. The difference, clamped at zero, is the loss; a region whose rule is not DROP loses nothing by construction and is zeroed.
Definition at line 661 of file solver_jmt.h.
References line::jmt::JmtResult< T >::avg, line::lang::DROP, line::jmt::JmtResult< T >::DropRateNfcr, jmt_region_losses(), line::Matrix< T >::Matrix(), line::qn::NetworkStruct< T >::Region::members, line::qn::NetworkStruct< T >::Region::rule, and line::jmt::JmtResult< T >::TNfcr.
Referenced by jmt_region_losses(), and solver_jmt_run_analyzer().
| JmtReplication< T > line::jmt::jmt_replication | ( | const qn::NetworkStruct< T > & | sn, |
| const JmtOptions & | opt ) |
Port of the replication method of @@SolverJMT/runAnalyzer.m.
A SINGLE SAMPLE PATH IS NOT THE TRANSIENT MEAN. There is no time-ergodicity at a fixed t, so E[N](t) is estimated by averaging iter_max INDEPENDENT replications, each seeded seed + it, rather than by reading one trajectory.
The replications have their own event grids, so they are resampled onto the union with a previous-value hold and the grid is truncated at the MINIMUM of their last events: past that point one replication has no data, and extending its last value would report a queue that stopped changing rather than one that stopped being observed – the same rule jmt_sample_sys_aggr applies across stations, applied here across seeds.
Utilization is min(n, c)/c at a finite server and the raw queue length at a delay; throughput follows it as U*c*mu and U*mu, which is how the reference reads departures off the occupancy rather than differencing the trajectory.
Definition at line 878 of file jmt_logs.h.
References line::InputError::InputError(), jmt_method_refusal(), jmt_replication(), jmt_sample_sys_aggr(), line::jmt::JmtOptions::method, line::jmt::JmtReplication< T >::QNt, line::jmt::JmtOptions::seed, line::Matrix< T >::size(), line::jmt::JmtReplication< T >::t, line::jmt::JmtReplication< T >::TNt, line::UnsupportedError::UnsupportedError(), line::jmt::JmtReplication< T >::UNt, and line::jmt::JmtReplication< T >::valid.
Referenced by jmt_replication().
|
inline |
The suffix jmt.commandline.Jmt appends to the model path, per mode.
Definition at line 278 of file solver_jmt.h.
References line::InputError::InputError(), and jmt_result_ext().
Referenced by jmt_result_ext(), jmt_run_docker(), jmt_solve_rest(), and solver_jmt_run_analyzer().
|
inline |
Port of jmtRun: one batch analysis, leaving the result where the JMT CLI itself would leave it.
| mode | "sim" or "mva" |
| model_path | the document JMT is to read; the result lands beside it |
Definition at line 340 of file solver_jmt.h.
References line::util::capture(), line::io::docker_daemon_available(), line::io::docker_has_local_image(), line::io::docker_has_storage_for(), line::io::docker_pull(), JMT_DOCKER_IMAGE, jmt_run(), jmt_run_docker(), jmt_solve_rest(), line::NumericError::NumericError(), line::util::ProcResult::timedOut, and line::UnsupportedError::UnsupportedError().
Referenced by jmt_run(), and solver_jmt_run_analyzer().
|
inline |
Run the analysis inside the JMT container and copy the result back beside the model, so the caller sees the layout a local JVM would have produced.
The model is STAGED under a fresh directory and the container is given that directory: in mva mode JMT rewrites the model file itself, and a confined Docker cannot bind-mount the system temp directory the model normally lives in. The container runs as the calling user so the files it writes are not left owned by root.
Definition at line 398 of file solver_jmt.h.
References line::util::capture(), jmt_result_ext(), jmt_run_docker(), line::NumericError::NumericError(), line::util::TempDir::path(), and line::util::ProcResult::timedOut.
Referenced by jmt_run(), and jmt_run_docker().
| 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.
The model is instrumented, simulated once, and the node's CSV pair read back. num_events bounds how much of the trajectory is returned, as the reference does; JMT CANNOT BE ASKED FOR A NUMBER OF EVENTS AT ONE NODE – maxEvents is global – so the count is a truncation of what the run produced and not a stopping rule, which is exactly the caveat the reference warns about.
Definition at line 450 of file jmt_logs.h.
References line::InputError::InputError(), jmt_link_and_log(), jmt_parse_logs(), jmt_sample_aggr(), line::util::TempDir::keep(), line::NumericError::NumericError(), line::util::TempDir::path(), and solver_jmt_run_analyzer().
Referenced by jmt_sample_aggr().
| 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.
The per-station traces have their OWN event times, so they are resampled onto the union grid with a PREVIOUS-value hold – a queue length is constant between its own events, so holding is exact rather than an interpolation. The grid is truncated at the earliest station's last event: past that point one station has no data, and extending its last value would report a queue that stopped changing rather than one that stopped being observed.
Definition at line 498 of file jmt_logs.h.
References line::jmt::JmtSysTrace< T >::event, jmt_link_and_log(), jmt_parse_logs(), jmt_sample_sys_aggr(), line::util::TempDir::keep(), line::jmt::JmtOptions::method, line::jmt::JmtEvent::node, line::util::TempDir::path(), solver_jmt_run_analyzer(), line::lang::Source, line::jmt::JmtSysTrace< T >::state, line::jmt::JmtEvent::t, and line::jmt::JmtSysTrace< T >::t.
Referenced by jmt_get_tran_prob_aggr(), jmt_prob_aggr(), jmt_replication(), and jmt_sample_sys_aggr().
|
inline |
Port of jmtSolveRest: POST the model document, write the result document back beside the model so the local parsers are unaffected.
Definition at line 293 of file solver_jmt.h.
References line::http::Response::body, line::util::ProcResult::exitCode, line::InputError::InputError(), jmt_result_ext(), jmt_solve_rest(), line::util::ProcResult::out, line::http::post_json(), and line::http::Response::status.
Referenced by jmt_run(), and jmt_solve_rest().
| JmtResult< T > line::jmt::solver_jmt_run_analyzer | ( | const qn::NetworkStruct< T > & | sn, |
| const JmtOptions & | opt_in ) |
Port of @@SolverJMT/runAnalyzer.m, the jsim and jmva arms.
The sample count is RAISED to 5000 when the caller asks for less, as the reference does: JMT terminates a measure on its own precision target and needs that many samples per measure before it will report one, so a smaller request silently yields unsuccessful measures rather than a faster run.
Definition at line 927 of file solver_jmt.h.
References line::jmt::JmtResult< T >::avg, line::io::JmtWriteOptions::file_name, line::lang::GlobalConstants::FineTol, jmt_list_valid_methods(), jmt_map_measures(), jmt_method_refusal(), jmt_parse_jmva(), jmt_parse_measures(), jmt_region_losses(), jmt_result_ext(), jmt_run(), line::io::jmt_write_jsim(), line::util::TempDir::keep(), line::io::JmtWriteOptions::log_path, line::io::JmtWriteOptions::max_samples, line::io::JmtWriteOptions::max_simulated_time, line::jmt::JmtOptions::method, line::util::ProcResult::out, line::util::TempDir::path(), line::io::JmtWriteOptions::seed, line::io::JmtWriteOptions::sim_conf_int, line::mva::sn_get_residt_from_respt(), solver_jmt_run_analyzer(), line::util::LineConsole::step(), line::util::LineConsole::substep(), line::UnsupportedError::UnsupportedError(), and line::io::write_jmva().
Referenced by line::NetworkSolver::avg_table(), jmt_get_cdf_resp_t(), jmt_sample_aggr(), jmt_sample_sys_aggr(), and solver_jmt_run_analyzer().
|
static |
The default JMT REST/Docker image, MATLAB's jmtDockerImage candidate.
Definition at line 83 of file solver_jmt.h.
Referenced by jmt_run().