Create Context » History » Revision 37
« Previous |
Revision 37/68
(diff)
| Next »
Tomislav Pleše, 09/29/2025 08:41 AM
Create Context¶
|- T-001: Shard-01
| |- T-004: Point
| |- T-015: Point
|- T-001: Shard-02
| |- T-016: Point
| |- T-017: Point
| |- T-005: Shard-01
| | |- T-006: Point
| | |- T-014: Point
| | |- T-007: Shard-01
| | | |- T-010: Point
| | | |- T-013: Point
| | |- T-007: Shard-02
| | | |- T-011: Point
| | | |- T-012: Point <-- starting point
| | |- T-007: Shard-03
| | |- T-008: Point
| |- T-005: Shard-02
| | |- T-018: Point
| |- T-005: Shard-03
| |- T-009: Point
|- T-001: Shard-03
|- T-002: Point
|- T-003: Point
Context: [012, 011, 007(S01+S02), 014, 006, 005(S01), 017, 016, 001(S01+S02) ]
| PointId | 012 | 007 | 005 | 001 |
|---|---|---|---|---|
| StartingPoint [in code] | 012 | 012 | 012 | 012 |
| PreviousPoint [in code] | "" | 012 | 007 | 005 |
| ParentPoint | 007 | 005 | 001 | 001 |
| PointChildren | null | null | null | [002, 003] |
| ShardList | null | [S01, S02, S03] | [S01, S02, S03] | [S01, S02, S03] |
| ParentShard | 007-S02 | 005-S01 | 001-S02 | null |
| CurrentParentShard [in code] | null | 007-S02 | 005-S01 | 001-S02 |
| ShardPointChildren | null | S02[011, 012] | S01[006, 014, 007] | S02[016, 017, 005, 009] |
| PRINT full: | 012 | 011, 007(S01+S02) | 014, 006, 005(S01) | 017, 016, 001(S01+S02) |
| 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) |
| * PRINT [011] | * PRINT [014, 006] | * PRINT [017, 016] | ||
| 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 |
| * PRINT: 012 | * PRINT: 007- [S01+S02] | * PRINT: 005-[S01] | * PRINT: 001-[S01+S02] | |
| If (ParentShard == null) | * False: Set CurrentParentShard = ParentShard | * False: Set CurrentParentShard = ParentShard | * False: Set CurrentParentShard = ParentShard | True: |
| If (ParentPoint == PointId) | * False: Set PreviousPoint = currentPoint | * False: Set PreviousPoint = currentPoint | * False: Set PreviousPoint = currentPoint | * True: This is Root ParentPoint - END |
| * Go to ParentPoint: 007 | Go to ParentPoint: 005 | Go to ParentPoint: 001 |
FLOW
PointArgs
- String currentPointId;
- String? parentPointId;
- String? parentShardId;
- bool isShardChild = false; // TODO TP: delete: do I need this? I have parentShardId
- int? startPosition;
- int? endPosition;
- String? error;
Decision points in the flow:
- Is previousPoint = null - new Root Point?
- Is previousPoint = Root - directly under Root - root.pointChildren[] -> previousPoint = Root
- Is previousPoint = rootChild - under Regular Point - root.pointChildren[] -> previousPoint = Child Point
- Is previousPoint = Shard - directly under Shard
- Is previousPoint = shardChild - under
- Is it a child of a Point /w Shard?
- If yes:
- If no: print currentPoint
Pseudo-Code
- currentPoint(T-012) = newPoint -> addToMessages[]
- What's the nextCurrentPoint? Is it a Sub Prompt (Sharding) product? (isNextPointAShard? -> nextPoint.shardsList[] != null || nextPoint.pointChilren[] != null)
- True:
- previousPoint = currentPoint;
- currentPoint = nextPoint
- False:
- previousPoint = currentPoint;
- currentPoint = nextPoint.parentPoint
- True:
- currentPoint(T-007)
- Does currentPoint have Shards? (currentPoint.shardsList[] != null)
- True:
- Find Shard: currentShard = currentPoint.shardsList.findPreviousPoint.parentShardId;
- Find previousPoint in the shardChildren: currentShard.shardChildren.findPreviousPoint
- addToMessages[].from.currentShard.shardChildren.fromPreviousPointIndex-1
- addToMessages[].from.shardsList.fromCurrentShardIndex.fromAnchorEndPoisition
- Does currentPoint have pointChildren (is it Root)? - if the flow goes through shardChildren (Root has Shards), then pointChildren come only after last Shard - so, not relevant
- True: not relevant
- False: not relevant
- False: Does currentPoint have pointChildren (is it Root)?
- True:
- Find previousPoint in pointChildren: currentPoint.pointChildren.findPreviousPoint
- addToMessages[].from.pointChildren.fromPreviousPointIndex-1
- addToMessages[].currentPoint
- False:
- addToMessages[].currentPoint
- True:
- True:
Updated by Tomislav Pleše 2 months ago · 68 revisions