Project

General

Profile

Create Context » History » Version 33

Tomislav Pleše, 09/29/2025 07:47 AM

1 1 Tomislav Pleše
# Create Context
2 2 Tomislav Pleše
3
4
|- T-001: Shard-01 
5
|  |- T-004: Point
6
|  |- T-015: Point
7
|- T-001: Shard-02
8
|  |- T-016: Point
9 3 Tomislav Pleše
|  |- T-017: Point
10 2 Tomislav Pleše
|  |- T-005: Shard-01 
11
|  |  |- T-006: Point
12
|  |  |- T-014: Point
13
|  |  |- T-007: Shard-01 
14
|  |  |  |- T-010: Point
15
|  |  |  |- T-013: Point 
16
|  |  |- T-007: Shard-02 
17
|  |  |  |- T-011: Point
18
|  |  |  |- T-012: Point  <-- starting point
19
|  |  |- T-007: Shard-03 
20
|  |  |- T-008: Point
21
|  |- T-005: Shard-02 
22
|  |  |- T-018: Point
23
|  |- T-005: Shard-03 
24
|  |- T-009: Point
25
|- T-001: Shard-03 
26
|- T-002: Point
27 3 Tomislav Pleše
|- T-003: Point
28 2 Tomislav Pleše
29 1 Tomislav Pleše
30 2 Tomislav Pleše
31 3 Tomislav Pleše
Context: [012, 011, 007(S01+S02), 014, 006, 005(S01), 017, 016, 001(S01+S02) ]
32 2 Tomislav Pleše
33 1 Tomislav Pleše
34 2 Tomislav Pleše
35 3 Tomislav Pleše
36 2 Tomislav Pleše
|     PointId                                                                                                |     012                                                |     007                                                                          |     005                                                                          |     001                                                                                                            |
37
|------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
38
|     StartingPoint   [in code]                                                                              |     012                                                |     012                                                                          |     012                                                                          |     012                                                                                                            |
39
|     PreviousPoint   [in code]                                                                              |     ""                                                 |     012                                                                          |     007                                                                          |     005                                                                                                            |
40
|     ParentPoint                                                                                            |     007                                                |     005                                                                          |     001                                                                          |     001                                                                                                            |
41
|     PointChildren                                                                                          |     null                                               |     null                                                                         |     null                                                                         |     [002, 003]                                                                                                     |
42
|     ShardList                                                                                              |     null                                               |     [S01, S02,   S03]                                                            |     [S01, S02,   S03]                                                            |     [S01, S02,   S03]                                                                                              |
43
|     ParentShard                                                                                            |     007-S02                                            |     005-S01                                                                      |     001-S02                                                                      |     null                                                                                                           |
44
|     CurrentParentShard   [in code]                                                                         |     null                                               |     007-S02                                                                      |     005-S01                                                                      |     001-S02                                                                                                        |
45
|     ShardPointChildren                                                                                     |     null                                               |     S02[011,   012]                                                              |     S01[006,   014, 007]                                                         |     S02[016,   017, 005, 009]                                                                                      |
46
|                                                                                                            |                                                        |                                                                                  |                                                                                  |                                                                                                                    |
47
|     PRINT full:                                                                                            |     012                                                |     011, 007(S01+S02)                                                            |     014, 006, 005(S01)                                                           |     017, 016, 001(S01+S02)                                                                                         |
48
|                                                                                                            |                                                        |                                                                                  |                                                                                  |                                                                                                                    |
49
|     If   (ShardPointChildren == null && currentParentShard == null) Else   (PointChildren == null)         |     * True:   not a Shard                              |     * False:   It's a shard. Print ShardPointChildren preceding PreviousPoint    |     * False:   It's a shard. Print ShardPointChildren preceding PreviousPoint    |     * False:   It's a shard. Print ShardPointChildren preceding PreviousPoint     (else,   print PointChildren)    |
50
|                                                                                                            |                                                        |     * PRINT [011]                                                                |     * PRINT [014, 006]                                                           |     * PRINT [017, 016]                                                                                             |
51
|     Print   CurrentPoint:     If(Shard)   => Print from ShardList     Else If   (!Shard) => Print Point    |     * Not a   Shard: Print Point                       |     * Shard:   Print ShardList from CurrentParentShard and those preceding       |     * Shard:   Print ShardList from CurrentParentShard and those preceding       |     * Shard:   Print ShardList from CurrentParentShard and those preceding                                         |
52
|                                                                                                            |     * PRINT: 012                                       |     * PRINT: 007- [S01+S02]                                                      |     * PRINT: 005-[S01]                                                           |     * PRINT: 001-[S01+S02]                                                                                         |
53
|     If   (ParentShard == null)                                                                             |     * False:   Set CurrentParentShard = ParentShard    |     * False:   Set CurrentParentShard = ParentShard                              |     * False:   Set CurrentParentShard = ParentShard                              |     True:                                                                                                          |
54 1 Tomislav Pleše
|     If   (ParentPoint == PointId)                                                                          |     * False:   Set PreviousPoint = currentPoint        |     * False:   Set PreviousPoint = currentPoint                                  |     * False:   Set PreviousPoint = currentPoint                                  |     * True:   This is Root ParentPoint - END                                                                       |
55
|                                                                                                            |     * Go to   ParentPoint: 007                         |     Go to   ParentPoint: 005                                                     |     Go to   ParentPoint: 001                                                     |                                                                                                                    |
56 3 Tomislav Pleše
57
58
59
FLOW
60
61 29 Tomislav Pleše
PointArgs
62
  * String currentPointId;
63
  * String? parentPointId;
64
  * String? parentShardId;
65
  * bool isShardChild = false; // TODO TP: delete: do I need this? I have parentShardId
66
  * int? startPosition;
67
  * int? endPosition;
68
  * String? error;
69 4 Tomislav Pleše
70 26 Tomislav Pleše
71 30 Tomislav Pleše
Decision points in the flow:
72
73 26 Tomislav Pleše
* Is previousPoint = null - new Root Point?
74
* Is previousPoint = Root - directly under Root - root.pointChildren[] -> previousPoint = Root
75 27 Tomislav Pleše
* Is previousPoint = rootChild - under Regular Point - root.pointChildren[] -> previousPoint = Child Point
76 28 Tomislav Pleše
* Is previousPoint = Shard - directly under Shard
77 1 Tomislav Pleše
* Is previousPoint = shardChild - under  
78
* Is it a child of a Point /w Shard?
79
  * If yes: 
80
  * If no:  print currentPoint
81
* 
82
83
84
85 30 Tomislav Pleše
Pseudo-Code 
86 29 Tomislav Pleše
 
87
1. currentPoint(T-012) = newPoint -> addToMessages[]
88 32 Tomislav Pleše
* What's the nextCurrentPoint?
89 33 Tomislav Pleše
  * Is it a Sub Prompt (Sharding) product? (isNextPointAShard? -> nextPoint.shardsList[] != null || nextPoint.pointChilren[] != null)
90
    * True: 
91
      * previousPoint = currentPoint; 
92
      * currentPoint = nextPoint
93
    * False: 
94
      * previousPoint = currentPoint; 
95
      * currentPoint = nextPoint.parentPoint
96 1 Tomislav Pleše
2. currentPoint(T-007)
97 33 Tomislav Pleše
  * Does currentPoint have Shards? (currentPoint.shardsList[] != null)
98 32 Tomislav Pleše
    * True: 
99 33 Tomislav Pleše
      * Find Shard: currentShardId = currentPoint.shardsList.findPreviousPoint.parentShardId; 
100
      * Find Previous Point in the shardChildren: currentShard.shardChildren.findPreviousPoint.id 
101
      * addToMessages[].from.currentPoint.shardList.shardId.shardChildren addToMessages[].fromPrevPointParentShardIndex-1
102 32 Tomislav Pleše
    * False: 
103
104
is the previousPoint a Shard Child? (prevPoint.parentShard != null) 
105 29 Tomislav Pleše
      * true: nextCurrentPoint = prevPoint.
106
      * false: 
107
  * is there a prevPoint.parentShardId?
108
    * true: newCurrentPoint = prevPoint.parentShardId
109
    * false: is there a prevPoint.parentPointId?
110
      * true: nextCurrentPoint = prevPoint.parentPointId
111
      * false: 
112
2. currentPoint = previousPoint
113
* isItRoot? - if (previousPoint.id = previousPoint.parentPointId) 
114
  * true: This is a Root Point -> addToMessages[] -> Return messages[]
115 26 Tomislav Pleše
  * false: Not a Root Point
116 29 Tomislav Pleše
* isItShard? - if (