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

The part of a network the TikZ exporter draws, and the text helpers the JAR's exporter uses to write it. More...

#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <limits>
#include <string>
#include <vector>
#include "line/lang/lang_types.h"
#include "line/lang/qn/network_struct.h"
#include "line/num/number.h"
Include dependency graph for tikz_graph.h:

Go to the source code of this file.

Classes

struct  line::io::TikzNode
 One node as the TikZ exporter sees it. More...
struct  line::io::TikzGraph
 Nodes in model order plus sn.connmatrix over them. More...

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::io
namespace  line::io::tikz_detail

Functions

std::string line::io::tikz_detail::java_sched_name (lang::SchedStrategy s)
 Java's SchedStrategy.name(): the enumerator spelling, which is the upper-cased text of sched_to_text.
std::string line::io::tikz_detail::java_fixed (double v, int prec)
 Java's String.format("%." + prec + "f", v).
std::string line::io::tikz_detail::sanitize_id (const std::string &name)
 name.replaceAll("[^a-zA-Z0-9]", "_"): one underscore per CODE POINT, so a UTF-8 sequence is one character.
void line::io::tikz_detail::replace_all (std::string &s, const std::string &from, const std::string &to)
std::string line::io::tikz_detail::escape_latex (std::string t)
 TikZNodeRenderer.escapeLatex, applied in the SAME sequence of whole-string replacements, so a backslash comes out as \textbackslash\{\}, exactly as the JAR's later brace replacement leaves it.
template<class T>
TikzGraph line::io::tikz_graph (const qn::NetworkStruct< T > &sn)
 The drawable graph of a network struct.

Detailed Description

The part of a network the TikZ exporter draws, and the text helpers the JAR's exporter uses to write it.

jline.io.tikz reads a live Network: its node objects (for their class and name), each Queue's discipline and server count, and sn.connmatrix. This port reads the same facts off a NetworkStruct once, into a TikzGraph, so the layout, routing and rendering stages below are plain functions of it.

THE CONNECTION MATRIX IS THE UNION SUPPORT OF THE ROUTING BLOCKS P, as in jmt_conn_matrix (jmt_writer.h): this port records links only through P, and Network::link has already replaced every class-switching link by the CS_i_to_j node the JAR inserts, so the topology is the JAR's, node for node.

NUMBERS ARE FORMATTED AS JAVA'S String.format("%.2f") DOES, not as printf does. Java rounds HALF UP on the shortest decimal expansion of the double, printf rounds the exact binary value half to even, and the two disagree on a coordinate such as 1.675 (printf 1.67, Java 1.68). Such coordinates do occur: a forward edge is routed at the MEAN height of its obstacles.

Definition in file tikz_graph.h.