Chain-Load: remove excess template argument
The number of nodes was just defined as template argument to get a cheap implementation through std::array... But actually this number of nodes is ''not a characteristics of the type;'' we'd end up with a distinct JobFunctor type for each different test size, which is plain nonsensical. Usage analysis reveals, now that the implementation is ''basically complete,'' that all of the topology generation and statistic calculation code does not integrate deeply with the node storage, but rather just iterates over all nodes and uses the ''first'' and ''last'' node. This can actually be achieved very easy with a heap-allocated plain array, relying on the magic of lib::IterExplorer for all iteration and transformation.
This commit is contained in:
parent
e0766f2262
commit
7d5242f604
3 changed files with 277 additions and 88 deletions
|
|
@ -54,8 +54,8 @@ namespace test {
|
|||
namespace { // shorthands and parameters for test...
|
||||
|
||||
/** shorthand for specific parameters employed by the following tests */
|
||||
using ChainLoad32 = TestChainLoad<32,16>;
|
||||
using Node = ChainLoad32::Node;
|
||||
using ChainLoad16 = TestChainLoad<16>;
|
||||
using Node = ChainLoad16::Node;
|
||||
auto isStartNode = [](Node& n){ return isStart(n); };
|
||||
auto isInnerNode = [](Node& n){ return isInner(n); };
|
||||
auto isExitNode = [](Node& n){ return isExit(n); };
|
||||
|
|
@ -106,8 +106,6 @@ namespace test {
|
|||
void
|
||||
verify_Node()
|
||||
{
|
||||
using Node = TestChainLoad<>::Node;
|
||||
|
||||
Node n0; // Default-created empty Node
|
||||
CHECK (n0.hash == 0);
|
||||
CHECK (n0.level == 0);
|
||||
|
|
@ -194,7 +192,7 @@ namespace test {
|
|||
void
|
||||
verify_Topology()
|
||||
{
|
||||
auto graph = ChainLoad32{}
|
||||
auto graph = ChainLoad16{32}
|
||||
.buildToplolgy();
|
||||
|
||||
CHECK (graph.topLevel() == 31);
|
||||
|
|
@ -249,7 +247,7 @@ namespace test {
|
|||
void
|
||||
showcase_Expansion()
|
||||
{
|
||||
ChainLoad32 graph;
|
||||
ChainLoad16 graph{32};
|
||||
|
||||
// moderate symmetrical expansion with 40% probability and maximal +2 links
|
||||
graph.expansionRule(graph.rule().probability(0.4).maxVal(2))
|
||||
|
|
@ -289,7 +287,7 @@ namespace test {
|
|||
|
||||
// if the generation is allowed to run for longer,
|
||||
// while more constrained in width...
|
||||
TestChainLoad<256,8> gra_2;
|
||||
TestChainLoad<8> gra_2{256};
|
||||
gra_2.expansionRule(gra_2.rule().probability(0.4).maxVal(2).shuffle(23))
|
||||
.buildToplolgy()
|
||||
// .printTopologyDOT()
|
||||
|
|
@ -319,7 +317,7 @@ namespace test {
|
|||
void
|
||||
showcase_Reduction()
|
||||
{
|
||||
ChainLoad32 graph;
|
||||
ChainLoad16 graph{32};
|
||||
|
||||
// expand immediately at start and then gradually reduce / join chains
|
||||
graph.expansionRule(graph.rule_atStart(8))
|
||||
|
|
@ -389,7 +387,7 @@ namespace test {
|
|||
void
|
||||
showcase_SeedChains()
|
||||
{
|
||||
ChainLoad32 graph;
|
||||
ChainLoad16 graph{32};
|
||||
|
||||
// randomly start new chains, to be carried-on linearly
|
||||
graph.seedingRule(graph.rule().probability(0.2).maxVal(3).shuffle())
|
||||
|
|
@ -448,7 +446,7 @@ namespace test {
|
|||
void
|
||||
showcase_PruneChains()
|
||||
{
|
||||
ChainLoad32 graph;
|
||||
ChainLoad16 graph{32};
|
||||
|
||||
// terminate chains randomly
|
||||
graph.pruningRule(graph.rule().probability(0.2))
|
||||
|
|
@ -589,7 +587,7 @@ namespace test {
|
|||
void
|
||||
showcase_StablePattern()
|
||||
{
|
||||
TestChainLoad<256> graph;
|
||||
ChainLoad16 graph{256};
|
||||
|
||||
// This example creates a repetitive, non-expanding stable pattern
|
||||
// comprised of four small graph segments, generated interleaved
|
||||
|
|
@ -852,7 +850,7 @@ namespace test {
|
|||
void
|
||||
verify_reseed_recalculate()
|
||||
{
|
||||
ChainLoad32 graph;
|
||||
ChainLoad16 graph{32};
|
||||
graph.expansionRule(graph.rule().probability(0.8).maxVal(1))
|
||||
.pruningRule(graph.rule().probability(0.6))
|
||||
.buildToplolgy();
|
||||
|
|
@ -961,7 +959,7 @@ namespace test {
|
|||
p2.level = 1;
|
||||
e.level = 2;
|
||||
|
||||
RandomChainCalcFunctor<32,16> chainJob{nodes[0]};
|
||||
RandomChainCalcFunctor<16> chainJob{nodes[0]};
|
||||
Job job0{chainJob
|
||||
,chainJob.encodeNodeID(0)
|
||||
,chainJob.encodeLevel(0)};
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ namespace test {
|
|||
* @tparam maxFan maximal fan-in/out from a node, also limits maximal parallel strands.
|
||||
* @see TestChainLoad_test
|
||||
*/
|
||||
template<size_t numNodes =DEFAULT_SIZ, size_t maxFan =DEFAULT_FAN>
|
||||
template<size_t maxFan =DEFAULT_FAN>
|
||||
class TestChainLoad
|
||||
: util::MoveOnly
|
||||
{
|
||||
|
|
@ -276,33 +276,40 @@ namespace test {
|
|||
|
||||
private:
|
||||
using NodeTab = typename Node::Tab;
|
||||
using NodeStorage = std::array<Node, numNodes>;
|
||||
using NodeIT = lib::RangeIter<Node*>;
|
||||
|
||||
std::unique_ptr<NodeStorage> nodes_;
|
||||
std::unique_ptr<Node[]> nodes_;
|
||||
size_t numNodes_;
|
||||
|
||||
Rule seedingRule_ {};
|
||||
Rule expansionRule_{};
|
||||
Rule reductionRule_{};
|
||||
Rule pruningRule_ {};
|
||||
|
||||
Node* frontNode() { return &nodes_[0]; }
|
||||
Node* afterNode() { return &nodes_[numNodes_]; }
|
||||
Node* backNode() { return &nodes_[numNodes_-1];}
|
||||
|
||||
public:
|
||||
TestChainLoad()
|
||||
: nodes_{new NodeStorage}
|
||||
{ }
|
||||
explicit
|
||||
TestChainLoad(size_t nodeCnt =DEFAULT_SIZ)
|
||||
: nodes_{new Node[nodeCnt]}
|
||||
, numNodes_{nodeCnt}
|
||||
{
|
||||
REQUIRE (1 < nodeCnt);
|
||||
}
|
||||
|
||||
|
||||
size_t size() const { return nodes_->size(); }
|
||||
size_t topLevel() const { return nodes_->back().level; }
|
||||
size_t getSeed() const { return nodes_->front().hash; }
|
||||
size_t getHash() const { return nodes_->back().hash; }
|
||||
size_t size() const { return afterNode() - frontNode(); }
|
||||
size_t topLevel() const { return unConst(this)->backNode()->level; }
|
||||
size_t getSeed() const { return unConst(this)->frontNode()->hash; }
|
||||
size_t getHash() const { return unConst(this)->backNode()->hash; } /////////////////////TODO combine hash of all exit nodes
|
||||
|
||||
|
||||
using NodeIter = decltype(lib::explore (std::declval<NodeStorage & >()));
|
||||
|
||||
NodeIter
|
||||
auto
|
||||
allNodes()
|
||||
{
|
||||
return lib::explore (*nodes_);
|
||||
return lib::explore (NodeIT{frontNode(),afterNode()});
|
||||
}
|
||||
auto
|
||||
allNodePtr()
|
||||
|
|
@ -311,7 +318,7 @@ namespace test {
|
|||
}
|
||||
|
||||
/** @return the node's index number, based on its storage location */
|
||||
size_t nodeID(Node const* n){ return size_t(n - &nodes_->front()); };
|
||||
size_t nodeID(Node const* n){ return n - frontNode(); };
|
||||
size_t nodeID(Node const& n){ return nodeID (&n); };
|
||||
|
||||
|
||||
|
|
@ -406,7 +413,7 @@ namespace test {
|
|||
NodeTab a,b, // working data for generation
|
||||
*curr{&a}, // the current set of nodes to carry on
|
||||
*next{&b}; // the next set of nodes connected to current
|
||||
Node* node = &nodes_->front();
|
||||
Node* node = frontNode();
|
||||
size_t level{0};
|
||||
|
||||
// transient snapshot of rules (non-copyable, once engaged)
|
||||
|
|
@ -417,7 +424,7 @@ namespace test {
|
|||
|
||||
// prepare building blocks for the topology generation...
|
||||
auto moreNext = [&]{ return next->size() < maxFan; };
|
||||
auto moreNodes = [&]{ return node < &nodes_->back(); };
|
||||
auto moreNodes = [&]{ return node < backNode(); };
|
||||
auto spaceLeft = [&]{ return moreNext() and moreNodes(); };
|
||||
auto addNode = [&](size_t seed =0)
|
||||
{
|
||||
|
|
@ -480,7 +487,7 @@ namespace test {
|
|||
ENSURE (not next->empty());
|
||||
++level;
|
||||
}
|
||||
ENSURE (node == &nodes_->back());
|
||||
ENSURE (node == backNode());
|
||||
// connect ends of all remaining chains to top-Node
|
||||
node->clear();
|
||||
node->level = level;
|
||||
|
|
@ -502,7 +509,7 @@ namespace test {
|
|||
TestChainLoad&&
|
||||
setSeed (size_t seed = rand())
|
||||
{
|
||||
nodes_->front().hash = seed;
|
||||
frontNode()->hash = seed;
|
||||
return move(*this);
|
||||
}
|
||||
|
||||
|
|
@ -611,8 +618,8 @@ namespace test {
|
|||
* and pruning._ The RandomDraw component used to implement those rules provides a builder-DSL
|
||||
* and accepts λ-bindings in various forms to influence mapping of Node hash into result parameters.
|
||||
*/
|
||||
template<size_t numNodes, size_t maxFan>
|
||||
class TestChainLoad<numNodes,maxFan>::NodeControlBinding
|
||||
template<size_t maxFan>
|
||||
class TestChainLoad<maxFan>::NodeControlBinding
|
||||
: public std::function<Param(Node*)>
|
||||
{
|
||||
protected:
|
||||
|
|
@ -631,8 +638,8 @@ namespace test {
|
|||
|
||||
static double
|
||||
guessHeight (size_t level)
|
||||
{ // heuristic guess, typically too low
|
||||
double expectedHeight = max (1u, numNodes/maxFan);
|
||||
{ // heuristic guess for a »fully stable state«
|
||||
double expectedHeight = 2*maxFan;
|
||||
return level / expectedHeight;
|
||||
}
|
||||
|
||||
|
|
@ -662,7 +669,8 @@ namespace test {
|
|||
};
|
||||
|
||||
/** allow rules additionally involving the height of the graph,
|
||||
* which also represents time. 1.0 refers to (guessed) _full height. */
|
||||
* which also represents time. 1.0 refers to _stable state generation,_
|
||||
* guessed as height Level ≡ 2·maxFan . */
|
||||
template<typename RES>
|
||||
struct Adaptor<RES(size_t,double)>
|
||||
{
|
||||
|
|
@ -879,9 +887,9 @@ namespace test {
|
|||
* - the weight centre of this category members
|
||||
* - the weight centre of according to density
|
||||
*/
|
||||
template<size_t numNodes, size_t maxFan>
|
||||
template<size_t maxFan>
|
||||
inline Statistic
|
||||
TestChainLoad<numNodes,maxFan>::computeGraphStatistics()
|
||||
TestChainLoad<maxFan>::computeGraphStatistics()
|
||||
{
|
||||
auto totalLevels = uint(topLevel());
|
||||
auto classify = prepareEvaluaions<Node>();
|
||||
|
|
@ -962,9 +970,9 @@ namespace test {
|
|||
* *no reliable indication of subgraphs*. The `SEGS` statistics may be misleading,
|
||||
* since these count only completely severed and restarted graphs.
|
||||
*/
|
||||
template<size_t numNodes, size_t maxFan>
|
||||
inline TestChainLoad<numNodes,maxFan>&&
|
||||
TestChainLoad<numNodes,maxFan>::printTopologyStatistics()
|
||||
template<size_t maxFan>
|
||||
inline TestChainLoad<maxFan>&&
|
||||
TestChainLoad<maxFan>::printTopologyStatistics()
|
||||
{
|
||||
cout << "INDI: cnt frac ∅pS ∅pL ∅pLW γL◆ γLW◆ γL⬙ γLW⬙\n";
|
||||
_Fmt line{"%4s: %3d %3.0f%% %5.1f %5.2f %4.2f %4.2f %4.2f %4.2f %4.2f\n"};
|
||||
|
|
@ -1000,11 +1008,11 @@ namespace test {
|
|||
|
||||
/* ========= Render Job generation and Scheduling ========= */
|
||||
|
||||
template<size_t numNodes, size_t maxFan>
|
||||
template<size_t maxFan>
|
||||
class RandomChainCalcFunctor
|
||||
: public NopJobFunctor
|
||||
{
|
||||
using Node = typename TestChainLoad<numNodes,maxFan>::Node;
|
||||
using Node = typename TestChainLoad<maxFan>::Node;
|
||||
|
||||
public:
|
||||
RandomChainCalcFunctor(Node& startNode)
|
||||
|
|
|
|||
|
|
@ -79737,9 +79737,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1701487268101" ID="ID_1972068234" MODIFIED="1701487296471" TEXT="Argumente sind sinnvoll, wenn sie für jeden Frame verschieden sind"/>
|
||||
<node CREATED="1701487308645" ID="ID_53693227" MODIFIED="1701487328511">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
⟹ man <i>könnte </i>Argumente <b>encodieren</b>
|
||||
|
|
@ -79763,9 +79761,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1701487539561" ID="ID_18561883" MODIFIED="1701487546642" TEXT="das greift der Segmentierung vor"/>
|
||||
<node CREATED="1701487590639" ID="ID_839764786" MODIFIED="1701487655403" TEXT="und stellt weitere Zustands-Abhängigkeit her">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
denn damit wäre nicht nur die Segmentation zu erhalten, sondern auch der Play-Prozess-Translator-Record — solange bis kein Job mehr „anrufen“ kann
|
||||
|
|
@ -79783,9 +79779,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#c8c0b6" COLOR="#435e98" CREATED="1701488083545" ID="ID_709873359" MODIFIED="1701488114912">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
<u>Fazit</u>: nein und YAGNI
|
||||
|
|
@ -99371,9 +99365,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<icon BUILTIN="info"/>
|
||||
<node COLOR="#338800" CREATED="1701313986968" ID="ID_332576900" MODIFIED="1701314035258" TEXT="rule_atStart">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
stattet jede seed-Node sofort mit einem festen Branch-Faktor aus
|
||||
|
|
@ -100350,9 +100342,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1701490209941" ID="ID_231328088" MODIFIED="1701490257231">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
<u>Stand</u>: noch nicht volltändig umgesetzt
|
||||
|
|
@ -100382,9 +100372,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1701488366430" ID="ID_1676473919" MODIFIED="1701488373146" TEXT="Steuerung des Zugriffs">
|
||||
<node CREATED="1701488374014" ID="ID_923328966" MODIFIED="1701488576222">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
für den eigentlichen Aufruf genügt ein <font face="Monospaced" color="#5c0e8a">Node*</font>
|
||||
|
|
@ -100397,9 +100385,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1701488579450" ID="ID_635811261" MODIFIED="1701488668523" TEXT="er muß nämlich das Mem-Layout von »Node« kennen">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
....und das hängt vom Template-Parameter der TestChainLoad ab (<font face="Monospaced" color="#6c2f31">size_t maxFan</font>)
|
||||
|
|
@ -100421,9 +100407,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#d2beaf" COLOR="#5c4d6e" CREATED="1701490990894" ID="ID_1939179952" MODIFIED="1701491019860" TEXT="welcher Realität??">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
weiß ja noch nicht, wie das für ProcNode implementiert wird
|
||||
|
|
@ -100439,9 +100423,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1701490603497" ID="ID_1528195432" MODIFIED="1701490623330" TEXT="⟹ bedeutet: aus der Zeit läßt sich nicht die Node rekonstruieren"/>
|
||||
<node CREATED="1701490811846" ID="ID_1106508882" MODIFIED="1701490839795">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
formal-Logisch entspräche der Node-Index dem <b><font face="Monospaced">srcRef</font></b>-Parameter
|
||||
|
|
@ -100489,9 +100471,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1701492530640" ID="ID_189764840" MODIFIED="1701492537823" TEXT="beachte: nur Dispatch-Zeit"/>
|
||||
<node CREATED="1701492538439" ID="ID_1396963090" MODIFIED="1701492582067" TEXT="hier geht es nicht um eine »Gesamt-Simulation«">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
also nicht um den gesamten Playback-Prozeß. Es müssen keinerlei Deadline-Planungen gemacht werden; das kommt alles Fix per Test-Setup
|
||||
|
|
@ -100502,9 +100482,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node CREATED="1701492433029" ID="ID_1524195763" MODIFIED="1701492496433" TEXT="geht per Level oder per Job-Nummer vor...">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
das könnten Varianten des Test-Setup sein; weiß noch nicht was hier gebraucht wird. Rein intuitiv würde ich erst mal nur nach dem Level vorgehen
|
||||
|
|
@ -100514,9 +100492,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node CREATED="1701492666350" ID="ID_1408515925" MODIFIED="1701492703698" TEXT="bekommt demnach die Level-Nr als einziges Job-Argument">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
das paßt doch hervorragend; LevelNr ≡ nominal time
|
||||
|
|
@ -100596,16 +100572,13 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1701630172579" ID="ID_665479593" MODIFIED="1701630209464" TEXT="die Vorgänger-Terme liegen lassen"/>
|
||||
<node CREATED="1701630235800" ID="ID_112345737" MODIFIED="1701630388553" TEXT="Test-Setup kann man ausnützen">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
wir wissen, daß es keine concurrent Aufrufe geben wird, und auch Allokation stellt kein Problem dar; wir können einfach State im »Test-Rahmen« liegen lassen
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<font NAME="SansSerif" SIZE="12"/>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -100624,6 +100597,218 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1701630922141" ID="ID_887329209" MODIFIED="1701630929224" TEXT="explizitie Vorbereitung möglich"/>
|
||||
<node CREATED="1701634155541" ID="ID_237095519" MODIFIED="1701634175327" TEXT="dafür möglichst generisch und klar"/>
|
||||
</node>
|
||||
<node CREATED="1701653204166" ID="ID_1263178085" MODIFIED="1701653207746" TEXT="Typen einrichten">
|
||||
<node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1701653208718" FOLDED="true" ID="ID_1927337889" MODIFIED="1701659244968" TEXT="Problem: TestChainLoad hat zu viele Template-Parameter">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1701653222644" ID="ID_1426060278" MODIFIED="1701653291333">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
die Node-Anzahl ist <i>inhaltlich </i>keine Typ-Eigenschaft
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
...sie ist rein aus Bequemlichkeit der Implementierung zum Template-Parameter geworden: ich hab nämlich ein std::array genommen
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1701658710162" ID="ID_115644353" MODIFIED="1701658733389" TEXT="wir würden unterschiedliche Funktor-Typen bekommen, bloß auf Basis der Testlänge">
|
||||
<icon BUILTIN="stop-sign"/>
|
||||
</node>
|
||||
<node COLOR="#5b280f" CREATED="1701653296594" FOLDED="true" ID="ID_216676285" MODIFIED="1701653397209" TEXT="den Node-Typ herausziehen">
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
<node CREATED="1701653303954" ID="ID_515859186" MODIFIED="1701653312324" TEXT="wäre zwar einerseits logisch"/>
|
||||
<node COLOR="#5b280f" CREATED="1701653312905" ID="ID_564726139" MODIFIED="1701653394066">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
aber dann <b>muß</b> er unter zwei Namen auftreten
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
...und zwar, weil ich <i>im Klassen-Scope einen Template-Namen nicht verdecken darf. </i>Leider verteilt sich der Node-bezogene Code zu ziemlich gleichen Teilen auf die Node-Klasse selber, und den umschließenen Scope
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="stop-sign"/>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#5b280f" CREATED="1701653406153" FOLDED="true" ID="ID_1819494760" MODIFIED="1701653432621" TEXT="die Nodes in einen Vector legen">
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
<node CREATED="1701653415010" ID="ID_1638546860" MODIFIED="1701653419303" TEXT="wäre ganz einfach"/>
|
||||
<node COLOR="#5b280f" CREATED="1701653419793" ID="ID_32386834" MODIFIED="1701653431033" TEXT="aber Node ist move-only">
|
||||
<icon BUILTIN="closed"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1701653479662" FOLDED="true" ID="ID_179446102" MODIFIED="1701653549369" TEXT="ScopedCollection verwenden">
|
||||
<node CREATED="1701653486328" ID="ID_1702357808" MODIFIED="1701653546868" TEXT="jaaaa... würde gehen">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
hier ist zwar die maxCapacity festgelegt, aber nur zur Erstellungs-Zeit. Das wäre ja genau, was hier gebraucht wird
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1701653490771" ID="ID_562781144" MODIFIED="1701653503210" TEXT="mää muh">
|
||||
<icon BUILTIN="smiley-neutral"/>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1701653550488" ID="ID_284692074" MODIFIED="1701656564473" TEXT="gleich direkt ein Heap-alloziertes Array halten">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1701653586564" ID="ID_590006795" MODIFIED="1701656560759" TEXT="wenn schon, dann einfach">
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1701653639596" ID="ID_542818108" MODIFIED="1701656557569" TEXT="ich arbeite nur mit dem front/back-Pointer">
|
||||
<icon BUILTIN="idea"/>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1701653597657" ID="ID_1094212301" MODIFIED="1701656555445" TEXT="einziger Knackpunkt: die Iteratoren">
|
||||
<node COLOR="#435e98" CREATED="1701653661417" ID="ID_1125020411" MODIFIED="1701656551659" TEXT="was „kann“ hier IterExplorer leisten?">
|
||||
<icon BUILTIN="help"/>
|
||||
<node CREATED="1701653890152" ID="ID_1910212062" MODIFIED="1701654036714" TEXT="also automatisch geht's nicht">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
weil wir aufbauen auf can_STL_ForEach.
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
hat nested-type "iterator"
|
||||
</li>
|
||||
<li>
|
||||
hat member-Funktionen begin() und end()
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
....außerdem wird dann das Hilfs-Template
|
||||
<font face="Monospaced">StlRange</font> auch noch
|
||||
initialisiert mit<br/>
|
||||
<font face="Monospaced">RangeIter{begin(con), end(con}</font>
|
||||
.... ��
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="stop-sign"/>
|
||||
</node>
|
||||
<node CREATED="1701654043979" ID="ID_131432892" MODIFIED="1701654078221" TEXT="der Explorer wird immer vom TestChainLoad selber erstellt"/>
|
||||
<node CREATED="1701654086003" ID="ID_338229663" MODIFIED="1701654327837" TEXT="dann könnten wir selber einen RangeIter bauen">
|
||||
<arrowlink COLOR="#fef7b9" DESTINATION="ID_1583207415" ENDARROW="Default" ENDINCLINATION="26;-35;" ID="Arrow_ID_231010486" STARTARROW="None" STARTINCLINATION="-128;7;"/>
|
||||
<icon BUILTIN="idea"/>
|
||||
<node CREATED="1701654102685" ID="ID_783145721" MODIFIED="1701654110596" TEXT="theoretisch sollte der mir Pointern funktionieren"/>
|
||||
<node CREATED="1701654228092" ID="ID_692165706" MODIFIED="1701654283225" TEXT="hab ich offensichtlich schon mal gemacht...">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
...darauf deuten die Komentare zur Typ-Inferenz hin:
|
||||
</p>
|
||||
<p>
|
||||
"when IT is just a pointer, we use the pointee as value type"
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1701654299367" ID="ID_1583207415" MODIFIED="1701656549906" TEXT="also mal versuchen....">
|
||||
<linktarget COLOR="#fef7b9" DESTINATION="ID_1583207415" ENDARROW="Default" ENDINCLINATION="26;-35;" ID="Arrow_ID_231010486" SOURCE="ID_338229663" STARTARROW="None" STARTINCLINATION="-128;7;"/>
|
||||
<icon BUILTIN="idea"/>
|
||||
<node CREATED="1701656355221" ID="ID_1823110831" MODIFIED="1701656465490" TEXT="muß dann Pointer auf letzte Node speichern"/>
|
||||
<node CREATED="1701656467134" ID="ID_1024074409" MODIFIED="1701656488304" TEXT="oder gleich die Anzahl Elemente ⟵ so ist's besser"/>
|
||||
<node CREATED="1701656489059" ID="ID_1964562292" MODIFIED="1701656505932" TEXT="interne Accessor-Funktionen schaffen">
|
||||
<node CREATED="1701656507931" ID="ID_687847216" MODIFIED="1701656511812" TEXT="frontNode()"/>
|
||||
<node CREATED="1701656512064" ID="ID_1780513797" MODIFIED="1701656514405" TEXT="backNode()"/>
|
||||
</node>
|
||||
<node CREATED="1701656516688" ID="ID_1749309074" MODIFIED="1701656530608" TEXT="Code wird einfacher ⟹ Bingo"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1701656537411" ID="ID_1058830446" MODIFIED="1701656545530" TEXT="Test läuft ohne Zicken">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1701657551162" ID="ID_949690271" MODIFIED="1701658686663">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
Template-Parameter <u><font face="Monospaced" color="#7f242e">numNodes</font></u> zurückbauen
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#435e98" CREATED="1701657586999" ID="ID_1354690592" MODIFIED="1701658665277" TEXT="Tja... ein Problem gibt es...">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1701657628910" ID="ID_599327691" MODIFIED="1701657649441" TEXT="guessHeight im RandomDraw-Binding">
|
||||
<icon BUILTIN="info"/>
|
||||
<node CREATED="1701657653244" ID="ID_697962718" MODIFIED="1701657664177" TEXT="konnte bisher auf den Template-Parmeter zurückgreifen"/>
|
||||
<node CREATED="1701657665525" ID="ID_1071535106" MODIFIED="1701657696097">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
wird in den Adaptoren verwendet — und die sind <b>statisch</b>
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1701657753449" ID="ID_711600424" MODIFIED="1701657781337" TEXT="Regeln auf Basis der Graph-Höhe..">
|
||||
<node CREATED="1701657782398" ID="ID_763891693" MODIFIED="1701657800274">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
das war mal eine <i>offensichtlich einfache Idee</i>
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1701657811493" ID="ID_592917769" MODIFIED="1701657835898" TEXT="stattdessen habe ich jetzt immer die rule_atStart verwendet"/>
|
||||
<node COLOR="#435e98" CREATED="1701658096011" ID="ID_1533549547" MODIFIED="1701658658632" TEXT="ganz wegwerfen?">
|
||||
<arrowlink COLOR="#fdedba" DESTINATION="ID_1190215348" ENDARROW="Default" ENDINCLINATION="-107;7;" ID="Arrow_ID_847243636" STARTARROW="None" STARTINCLINATION="-3;34;"/>
|
||||
<icon BUILTIN="help"/>
|
||||
<node CREATED="1701658153692" ID="ID_1991604019" MODIFIED="1701658164279" TEXT="Sinnhaftigkeit ist fraglich"/>
|
||||
<node CREATED="1701658164915" ID="ID_1416043345" MODIFIED="1701658174341" TEXT="die Zahl ist nur eine Schätzung"/>
|
||||
<node CREATED="1701658188415" ID="ID_1233591043" MODIFIED="1701658190546" TEXT="tatsächlich hängt das von der Node-Dichte ab"/>
|
||||
<node CREATED="1701658193224" ID="ID_1734089022" MODIFIED="1701658204817" TEXT="aber ein generisches Maß wäre schon nützlich"/>
|
||||
<node CREATED="1701658208645" ID="ID_107836529" MODIFIED="1701658237677" TEXT="hab ja noch keine wirklichen Lasttests gemacht..."/>
|
||||
<node CREATED="1701658243312" ID="ID_1190215348" MODIFIED="1701658651273">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
man könnte das <i>anders interpretieren</i>
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<linktarget COLOR="#fdedba" DESTINATION="ID_1190215348" ENDARROW="Default" ENDINCLINATION="-107;7;" ID="Arrow_ID_847243636" SOURCE="ID_1533549547" STARTARROW="None" STARTINCLINATION="-3;34;"/>
|
||||
<icon BUILTIN="idea"/>
|
||||
<node CREATED="1701658257400" ID="ID_1461207497" MODIFIED="1701658265633" TEXT="es ist nämlich so: es gibt eine Start-Phase"/>
|
||||
<node CREATED="1701658266461" ID="ID_299146396" MODIFIED="1701658275460" TEXT="und irgendwann ist man im stationären Zustand"/>
|
||||
<node CREATED="1701658282683" ID="ID_109433705" MODIFIED="1701658326281" TEXT="⟹ Heuristik 1.0 ≙ 2·nodeFan"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1701658667991" ID="ID_1891737219" MODIFIED="1701658685029" TEXT="ansonsten ging das problemlos">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1701493082582" ID="ID_1894179968" MODIFIED="1701493117170" TEXT="Dispatcher-Job implementieren">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
|
|
@ -111121,9 +111306,7 @@ class Something
|
|||
<icon BUILTIN="bell"/>
|
||||
<node CREATED="1701555969695" ID="ID_1535597438" MODIFIED="1701556221036" TEXT="„char is calling for trouble“">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
Da alignof(char) ≡ 1, ist es gradezu eine »Steilvorlage« für Probleme, wenn man einen Allocation-Buffer per char[] deklariert. GCC macht das nicht (er fängt Allokationen immer an 64bit-Grenzen an), aber grundsätzlich dürfte ein Compiler ein char[] anfangen, wo er grad' lustig ist. Besonders gefährlich, wenn das Array <i>in ein anderes Objekt eingebettet</i> wird. Nur den zuletzt genannten Fall habe ich 2019 abgeklärt; gegen alle sonstigen <i>Schnaps-Ideen </i>gibt es keinen Schutz — es sei denn, man hält sich an die Sprachmittel
|
||||
|
|
|
|||
Loading…
Reference in a new issue