LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
infer_minps_setup.h File Reference

Turn a raw per-class trace into the sample set MINPS estimates from. More...

#include <algorithm>
#include <cstddef>
#include <vector>
#include "line/api/infer/infer_get_qlen_arrival.h"
#include "line/api/infer/infer_mlps.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for infer_minps_setup.h:

Go to the source code of this file.

Classes

struct  line::api::MinpsClassTrace
 One class's raw trace: when its jobs arrived, and how long they took. More...
struct  line::api::MinpsSetup
 The prepared sample set, plus what the preparation had to decide. More...

Namespaces

namespace  line
namespace  line::api

Functions

MinpsSetup line::api::infer_minps_setup (const std::vector< MinpsClassTrace > &traces, std::size_t initSample, std::size_t sampleSize)
 Turn a raw per-class trace into the sample set MINPS estimates from.
std::vector< double > line::api::infer_minps_from_trace (const std::vector< MinpsClassTrace > &traces, std::size_t initSample, std::size_t sampleSize, double nCores)
 Prepare the trace and run MINPS on it, as the reference's last line does.

Detailed Description

Turn a raw per-class trace into the sample set MINPS estimates from.

Port of matlab/src/api/infer/infer_minps_setup.m, which is MATLAB-ONLY – there is no JAR or native-Python twin.

WHAT IT DOES, in the reference's order, because each step changes what the estimator sees:

  1. DROP the classes with no samples. A class that never appears carries no information, and leaving it in shifts every later class's index, so the drop is a RELABELLING and the caller is told the surviving order.
  2. Derive the per-class queue lengths at arrival (infer_get_qlen_arrival).
  3. Merge the classes into one stream SORTED BY ARRIVAL TIME. That is the whole point of the sort: the estimator conditions on the state a job found, so the samples have to be in the order the system produced them, not grouped by class.
  4. Take the contiguous window [initSample, initSample+sampleSize). A window, not a random subset, again because the state a job finds is only meaningful within a contiguous stretch of the trace.
  5. Drop samples whose response time is not positive; they have no phase-type density.
  6. Estimate the think-time rates, capped at 1e6, which is also the value a negative estimate is replaced by.

ARITHMETIC: double, following the estimator it feeds.

Definition in file infer_minps_setup.h.