@hatiolab/things-scene 10.0.0-beta.125 → 10.0.0-beta.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-types/components/container-abstract.d.ts +2 -6
- package/dist-types/components/container-abstract.d.ts.map +1 -1
- package/dist-types/components/data/data.d.ts.map +1 -1
- package/dist-types/components/line.d.ts.map +1 -1
- package/dist-types/components/mixins/holdable.d.ts +12 -0
- package/dist-types/components/mixins/holdable.d.ts.map +1 -0
- package/dist-types/components/mixins/move-handle.d.ts +9 -16
- package/dist-types/components/mixins/move-handle.d.ts.map +1 -1
- package/dist-types/components/polyline.d.ts +6 -0
- package/dist-types/components/polyline.d.ts.map +1 -1
- package/dist-types/components/root-container.d.ts +0 -11
- package/dist-types/components/root-container.d.ts.map +1 -1
- package/dist-types/diagnostics/contract-inspector.d.ts +1 -1
- package/dist-types/diagnostics/contract-inspector.d.ts.map +1 -1
- package/dist-types/diagnostics/data-lag-tracker.d.ts +31 -25
- package/dist-types/diagnostics/data-lag-tracker.d.ts.map +1 -1
- package/dist-types/diagnostics/inspector.d.ts +15 -15
- package/dist-types/diagnostics/inspector.d.ts.map +1 -1
- package/dist-types/diagnostics/loading-overlay.d.ts.map +1 -1
- package/dist-types/flow/auto-route.d.ts +36 -0
- package/dist-types/flow/auto-route.d.ts.map +1 -0
- package/dist-types/flow/face-anchors.d.ts +26 -0
- package/dist-types/flow/face-anchors.d.ts.map +1 -0
- package/dist-types/flow/flow-engine.d.ts +122 -0
- package/dist-types/flow/flow-engine.d.ts.map +1 -0
- package/dist-types/flow/flow-graph-coordinator.d.ts +80 -0
- package/dist-types/flow/flow-graph-coordinator.d.ts.map +1 -0
- package/dist-types/flow/flow-graph-validator.d.ts +33 -0
- package/dist-types/flow/flow-graph-validator.d.ts.map +1 -0
- package/dist-types/flow/flow-graph.d.ts +76 -0
- package/dist-types/flow/flow-graph.d.ts.map +1 -0
- package/dist-types/flow/flow-introspection.d.ts +36 -0
- package/dist-types/flow/flow-introspection.d.ts.map +1 -0
- package/dist-types/flow/flow-node.d.ts +69 -0
- package/dist-types/flow/flow-node.d.ts.map +1 -0
- package/dist-types/flow/flow-orientation-coordinator.d.ts +13 -0
- package/dist-types/flow/flow-orientation-coordinator.d.ts.map +1 -0
- package/dist-types/flow/flow-orientation.d.ts +42 -0
- package/dist-types/flow/flow-orientation.d.ts.map +1 -0
- package/dist-types/flow/flow-trace.d.ts +5 -0
- package/dist-types/flow/flow-trace.d.ts.map +1 -0
- package/dist-types/flow/index.d.ts +16 -0
- package/dist-types/flow/index.d.ts.map +1 -0
- package/dist-types/flow/segment-topology.d.ts +225 -0
- package/dist-types/flow/segment-topology.d.ts.map +1 -0
- package/dist-types/flow/station-host-inference.d.ts +23 -0
- package/dist-types/flow/station-host-inference.d.ts.map +1 -0
- package/dist-types/items/arrangement/centering-queue-strategy.d.ts +10 -0
- package/dist-types/items/arrangement/centering-queue-strategy.d.ts.map +1 -0
- package/dist-types/items/arrangement/gravity-strategy.d.ts +9 -0
- package/dist-types/items/arrangement/gravity-strategy.d.ts.map +1 -0
- package/dist-types/items/arrangement/grid-strategy.d.ts +11 -0
- package/dist-types/items/arrangement/grid-strategy.d.ts.map +1 -0
- package/dist-types/items/arrangement/index.d.ts +7 -0
- package/dist-types/items/arrangement/index.d.ts.map +1 -0
- package/dist-types/items/arrangement/queue-strategy.d.ts +9 -0
- package/dist-types/items/arrangement/queue-strategy.d.ts.map +1 -0
- package/dist-types/items/arrangement/shelf-strategy.d.ts +11 -0
- package/dist-types/items/arrangement/shelf-strategy.d.ts.map +1 -0
- package/dist-types/items/arrangement/stack-strategy.d.ts +9 -0
- package/dist-types/items/arrangement/stack-strategy.d.ts.map +1 -0
- package/dist-types/items/capacity-mixin.d.ts +298 -0
- package/dist-types/items/capacity-mixin.d.ts.map +1 -0
- package/dist-types/items/capacity.d.ts +53 -0
- package/dist-types/items/capacity.d.ts.map +1 -0
- package/dist-types/items/index.d.ts +5 -0
- package/dist-types/items/index.d.ts.map +1 -0
- package/dist-types/items/items-data-binding.d.ts +79 -0
- package/dist-types/items/items-data-binding.d.ts.map +1 -0
- package/dist-types/items/slot-record.d.ts +23 -0
- package/dist-types/items/slot-record.d.ts.map +1 -0
- package/dist-types/layer/modeler/index.d.ts +1 -0
- package/dist-types/layer/modeler/index.d.ts.map +1 -1
- package/dist-types/layer/modeler/move-handle-icon.d.ts +2 -0
- package/dist-types/layer/modeler/move-handle-icon.d.ts.map +1 -0
- package/dist-types/layer/modeler/move-handle-modeler.d.ts +18 -0
- package/dist-types/layer/modeler/move-handle-modeler.d.ts.map +1 -0
- package/dist-types/layer/modeler/path-handler.d.ts.map +1 -1
- package/dist-types/layer/modeling-layer.d.ts +10 -0
- package/dist-types/layer/modeling-layer.d.ts.map +1 -1
- package/dist-types/layer/selection-layer.d.ts +1 -1
- package/dist-types/layer/selection-layer.d.ts.map +1 -1
- package/dist-types/things-scene/application-context.d.ts +6 -2
- package/dist-types/things-scene/application-context.d.ts.map +1 -1
- package/dist-types/things-scene/index.d.ts +5 -2
- package/dist-types/things-scene/index.d.ts.map +1 -1
- package/dist-types/threed/managers/vertex-gizmo-manager.d.ts.map +1 -1
- package/dist-types/threed/three-capability.d.ts +2 -2
- package/dist-types/threed/three-capability.d.ts.map +1 -1
- package/dist-types/transfer/container-capacity-helpers.d.ts +18 -0
- package/dist-types/transfer/container-capacity-helpers.d.ts.map +1 -0
- package/dist-types/transfer/container-capacity.d.ts +5 -374
- package/dist-types/transfer/container-capacity.d.ts.map +1 -1
- package/dist-types/transfer/index.d.ts +3 -0
- package/dist-types/transfer/index.d.ts.map +1 -1
- package/dist-types/transfer/transferable-mixin.d.ts +259 -0
- package/dist-types/transfer/transferable-mixin.d.ts.map +1 -0
- package/package.json +1 -1
- package/things-scene-min.js +7 -7
- package/things-scene-min.js.map +1 -1
- package/things-scene-transfer.mjs +3 -2
- package/things-scene.mjs +3 -3
- package/things-scene.mjs.map +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type FlowGraph, type NextHopCandidate } from './flow-graph.js';
|
|
2
|
+
import { type FlowGraphIssue } from './flow-graph-validator.js';
|
|
3
|
+
/** RoutingTarget capability — sink 가 자기 담당 행선지 값을 자가선언. */
|
|
4
|
+
export interface RoutingTarget {
|
|
5
|
+
/** 담당 행선지 값 (매칭 전용 — findById 대상 아님). */
|
|
6
|
+
routingDestination(): string;
|
|
7
|
+
/** (optional, Phase B1) 같은 destination N sink 분산 가중치. 미구현 = 1. */
|
|
8
|
+
routingWeight?(): number;
|
|
9
|
+
}
|
|
10
|
+
export declare function isRoutingTarget(c: any): c is RoutingTarget;
|
|
11
|
+
/**
|
|
12
|
+
* board load 시점 검출된 validate issues — UI overlay / 사용자 안내 진입점.
|
|
13
|
+
* 빈 array = 통과. error 가 있으면 호출부가 시뮬 시작 차단 권장.
|
|
14
|
+
*/
|
|
15
|
+
export declare function flowGraphIssues(root: any): FlowGraphIssue[];
|
|
16
|
+
/** root 의 방향 그래프 (캐시). 노드 0 이면 null. */
|
|
17
|
+
export declare function flowGraphFor(root: any): FlowGraph | null;
|
|
18
|
+
/** 행선지 값 → 담당 sink 노드 id 들. */
|
|
19
|
+
export declare function sinksForDestination(root: any, destination: string): string[];
|
|
20
|
+
/** 노드 id → 컴포넌트. */
|
|
21
|
+
export declare function componentForNode(root: any, id: string): any;
|
|
22
|
+
/** root 전체의 행선지 값 목록 (중복 제거). generator 가 후보로 사용. */
|
|
23
|
+
export declare function allDestinations(root: any): string[];
|
|
24
|
+
/** 컴포넌트의 그래프 노드 id (id ?? refid). 분기점이 자기 노드 식별에. */
|
|
25
|
+
export declare function nodeIdOf(c: any): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Phase B2 — balancing 정책.
|
|
28
|
+
* - index : outbound index 순 첫 후보 (= legacy 동작)
|
|
29
|
+
* - round-robin : 같은 hops 동률 후보 사이 순환 (default)
|
|
30
|
+
* - weight : 동률 후보의 target sink 의 routingWeight 비례 weighted-round-robin
|
|
31
|
+
* (random 회피 — 결정론 보장)
|
|
32
|
+
* - utilization : 동률 후보의 target sink 의 점유율 (inventoryCount / capacity) 가장 낮은
|
|
33
|
+
*/
|
|
34
|
+
export type BalancingPolicy = 'index' | 'round-robin' | 'weight' | 'utilization';
|
|
35
|
+
/** per-root balancing state — round-robin counter. root 가 새로 생기면 자동 초기화 (cache 와 동일). */
|
|
36
|
+
export interface BalancingState {
|
|
37
|
+
/** hostId → counter. round-robin / weight 정책이 사용. */
|
|
38
|
+
counters: Map<string, number>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Phase B2 balancing — 동률 후보 중 정책으로 선택. *_Internal helper, exported for unit test_*.
|
|
42
|
+
*/
|
|
43
|
+
export declare function applyPolicy(policy: BalancingPolicy, hostId: string, state: BalancingState, tied: NextHopCandidate[], components: Map<string, any>): NextHopCandidate;
|
|
44
|
+
/**
|
|
45
|
+
* 분기점(joint/sorter)이 carrier 를 어느 하류로 보낼지 — 목적지 지향 next-hop.
|
|
46
|
+
* 반환 = 고른 *하류 이웃 노드 id* (= 그 OUT 의 연결 대상). 없으면 null (목적지
|
|
47
|
+
* 미상/도달 불가/그래프 없음 → 호출부가 기존 로직 fallback). 호출부는 이 id 로
|
|
48
|
+
* 자기 port/opening(targetRef/neighborId) 을 매칭 — index 정렬 불일치 회피.
|
|
49
|
+
*
|
|
50
|
+
* # 절차
|
|
51
|
+
* 1. carrier.meta.destination(행선지 값) → 그 값을 담당하는 sink 노드들
|
|
52
|
+
* (없으면 dest 자체를 노드 id 로 — 단일 sink fallback).
|
|
53
|
+
* 2. nextHopsToAnyDetailed — 각 outbound 의 가까운 sink + hops 측정. 도달 불가
|
|
54
|
+
* outbound 는 자연 제외.
|
|
55
|
+
* 3. canReceive=true 후보만 필터 (capacity-reactive). 전부 막힘 → 최단으로 대기.
|
|
56
|
+
* 4. *_도달 가능한 모든 outbound_* 에 balancing policy 적용 (hops 동률 제약 없음).
|
|
57
|
+
*
|
|
58
|
+
* # 왜 hops 동률 제약을 두지 않는가 (Phase B6 의 본질 결정, 2026-06-17)
|
|
59
|
+
* "효율 (최단 hops)" 과 "분산 (throughput / capacity)" 의 두 가치가 충돌하면, 시스템
|
|
60
|
+
* 이 자동 선택할 수 없다 — 사용자 의도가 어느 쪽인지 *_시스템은 모름_*. 추측은
|
|
61
|
+
* 마술적이지만 잘못됐을 때 제어 불가.
|
|
62
|
+
*
|
|
63
|
+
* 그러나 *_사용자가 같은 destination 의 N sink 를 board 에 만든 사실 자체_* 가
|
|
64
|
+
* 이미 의도의 표현이다. 효율만 원했다면 1 개만 만들었을 것 — N 개 만든 것은:
|
|
65
|
+
* - "이 destination 의 capacity 를 N 배로" (예: chute 막힘 회피)
|
|
66
|
+
* - "후속 처리 N 라인 동시 부하" (throughput)
|
|
67
|
+
* 어느 쪽이든 *_분산 우선_* 의 표현.
|
|
68
|
+
*
|
|
69
|
+
* 따라서 default = *_모든 도달 가능 sink 사이 분산_* (hops 무관). 효율 우선 시나리오
|
|
70
|
+
* (드물게 있다면) 는 향후 `'shortest'` 같은 opt-in 정책으로 *_명시_* 표현하면 됨.
|
|
71
|
+
*
|
|
72
|
+
* # Phase B2 — 정책 enum
|
|
73
|
+
* policy 결정 우선순위: options.policy → per-host (self.state.balancingPolicy)
|
|
74
|
+
* → root (root.state.routingBalancingPolicy) → default 'round-robin'.
|
|
75
|
+
* 모든 정책은 *_도달 가능한 receivable 전체_* 에 적용 (= Phase B6 의 원칙).
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolveNextHop(self: any, carrier: any, options?: {
|
|
78
|
+
policy?: BalancingPolicy;
|
|
79
|
+
}): string | null;
|
|
80
|
+
//# sourceMappingURL=flow-graph-coordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-graph-coordinator.d.ts","sourceRoot":"","sources":["../../src/flow/flow-graph-coordinator.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAyC,KAAK,SAA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,gBAAgB,EAAE,EACxB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAC3B,gBAAgB,CAsClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG,MAAM,GAAG,IAAI,CAqC7G"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FlowGraph } from './flow-graph.js';
|
|
2
|
+
export type IssueSeverity = 'error' | 'warning';
|
|
3
|
+
export type IssueCode = 'orphan-source' | 'dead-end' | 'cycle' | 'unreachable-target' | 'invalid-weight';
|
|
4
|
+
export interface FlowGraphIssue {
|
|
5
|
+
severity: IssueSeverity;
|
|
6
|
+
code: IssueCode;
|
|
7
|
+
nodeId?: string;
|
|
8
|
+
/** cycle 의 경우 노드 체인 (정렬: 시작 = lexically min id, 결정론). */
|
|
9
|
+
cycle?: string[];
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ValidateOptions {
|
|
13
|
+
/**
|
|
14
|
+
* 의도 cycle 자격 — 해당 노드 id 의 cycle 은 skip (예: LoopSorter / LoopConveyor).
|
|
15
|
+
* 호출자가 root walk 로 isLoop capability 식별 후 전달. validator 자체는 순수.
|
|
16
|
+
*/
|
|
17
|
+
loopCapableIds?: ReadonlySet<string>;
|
|
18
|
+
/**
|
|
19
|
+
* RoutingTarget 자격 노드 id 목록 — sink (dead-end 자격 면제) 판단 + unreachable 검사.
|
|
20
|
+
* coordinator 의 destToSinks 키로 도출 가능.
|
|
21
|
+
*/
|
|
22
|
+
routingTargetIds?: ReadonlySet<string>;
|
|
23
|
+
/**
|
|
24
|
+
* (Phase B1) routingWeight 추출 결과 — nodeId → weight. 미선언/default 1 인 노드는
|
|
25
|
+
* 생략 가능. validator 가 weight ≤ 0 의 invalid-weight warning 검출.
|
|
26
|
+
*/
|
|
27
|
+
routingWeights?: ReadonlyMap<string, number>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* graph 의 invariants 검증. 같은 입력 → 같은 결과 (결정론).
|
|
31
|
+
*/
|
|
32
|
+
export declare function validate(graph: FlowGraph, opts?: ValidateOptions): FlowGraphIssue[];
|
|
33
|
+
//# sourceMappingURL=flow-graph-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-graph-validator.d.ts","sourceRoot":"","sources":["../../src/flow/flow-graph-validator.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,CAAA;AAC/C,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,oBAAoB,GAAG,gBAAgB,CAAA;AAExG,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,aAAa,CAAA;IACvB,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAEpC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAEtC;;;OAGG;IACH,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC7C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,GAAE,eAAoB,GAAG,cAAc,EAAE,CA8FvF"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type SegmentTopology, type SegmentBounds, type MatchTolerance } from './segment-topology.js';
|
|
2
|
+
/** 그래프 노드 입력 — collectAdjacentSegments 출력과 동일 shape. */
|
|
3
|
+
export interface FlowGraphNode {
|
|
4
|
+
id: string;
|
|
5
|
+
topology: SegmentTopology;
|
|
6
|
+
bounds?: SegmentBounds;
|
|
7
|
+
/**
|
|
8
|
+
* 명시 링크 — 사용자가 *명시 id* 로 지정한 그래프 엣지. 인접(기하) 자동연결로는
|
|
9
|
+
* 못 잇는 *떨어진 타겟*(예: 슈트 → 멀리 있는 StockPile)을 연결. 인접 엣지에 *추가*
|
|
10
|
+
* (대체 아님). coordinator 가 RoutingLinks capability 에서 채운다. refid 아님(시스템
|
|
11
|
+
* auto-link 와 별개) — 사용자 명시 id.
|
|
12
|
+
*/
|
|
13
|
+
links?: {
|
|
14
|
+
/** 이 노드 → target 노드 id(들). */
|
|
15
|
+
downstream?: string[];
|
|
16
|
+
/** source 노드 id(들) → 이 노드. */
|
|
17
|
+
upstream?: string[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** 산출된 방향 그래프. */
|
|
21
|
+
export interface FlowGraph {
|
|
22
|
+
/** id → 노드. */
|
|
23
|
+
nodes: Map<string, FlowGraphNode>;
|
|
24
|
+
/** id → outbound 별 연결 대상 id (없으면 null). index = outbound 순서. */
|
|
25
|
+
out: Map<string, Array<string | null>>;
|
|
26
|
+
/** 말단(outbound 연결 0) — 목적지 후보. */
|
|
27
|
+
sinks: Set<string>;
|
|
28
|
+
/** 진입원(inbound 연결 0). */
|
|
29
|
+
sources: Set<string>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 노드 목록 → 방향 그래프. 간선은 matchOutbounds(anchor 정밀 + footprint 배달)
|
|
33
|
+
* 재사용 — 컨베이어 자동연결과 *동일 판정*이라 그래프가 실제 흐름과 일치.
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildFlowGraph(nodes: ReadonlyArray<FlowGraphNode>, tolerance?: MatchTolerance): FlowGraph;
|
|
36
|
+
/**
|
|
37
|
+
* fromId 의 *각 outbound* 에서 도달 가능한 노드 집합. 반환 index = outbound 순서.
|
|
38
|
+
* 연결 없는 outbound = 빈 집합. 분기점 next-hop 선택의 1차 재료.
|
|
39
|
+
*/
|
|
40
|
+
export declare function reachableByOutbound(graph: FlowGraph, fromId: string): Set<string>[];
|
|
41
|
+
/**
|
|
42
|
+
* fromId 에서 destId 로 가까워지는 *outbound index 목록*, **최단 hop 우선 정렬**.
|
|
43
|
+
* 동률은 index 순(결정적). 여러 개면 상위(resolver)가 capacity 등으로 tie-break.
|
|
44
|
+
* 빈 배열 = 도달 불가(이 노드에선 막힘).
|
|
45
|
+
*/
|
|
46
|
+
export declare function nextHops(graph: FlowGraph, fromId: string, destId: string): number[];
|
|
47
|
+
/**
|
|
48
|
+
* fromId 에서 destId 로 가는 *최단 outbound index 1개* (없으면 -1). resolver 가
|
|
49
|
+
* capacity 무관할 때의 기본 선택. capacity-reactive 는 nextHops 전체를 받아 거른다.
|
|
50
|
+
*/
|
|
51
|
+
export declare function nextHop(graph: FlowGraph, fromId: string, destId: string): number;
|
|
52
|
+
/** fromId 가 destId 에 도달 가능한가 (어느 outbound 로든). dispatcher canReach 의 망 판정. */
|
|
53
|
+
export declare function canReach(graph: FlowGraph, fromId: string, destId: string): boolean;
|
|
54
|
+
/** fromId 에서 도달 가능한 *말단(sink) 노드 집합*. generator 가 보낼 수 있는 목적지 후보. */
|
|
55
|
+
export declare function reachableSinks(graph: FlowGraph, fromId: string): Set<string>;
|
|
56
|
+
/**
|
|
57
|
+
* fromId 에서 *목적지 값을 담당하는 여러 sink 중 아무거나* 로 가까워지는 outbound
|
|
58
|
+
* index 목록 (최단 hop 우선). 논리 목적지를 담당하는 물리 sink 가 여럿일 때
|
|
59
|
+
* (= 부하분산 여지). destIds = 그 목적지를 담당하는 sink 노드 id 들.
|
|
60
|
+
*/
|
|
61
|
+
export declare function nextHopsToAny(graph: FlowGraph, fromId: string, destIds: Iterable<string>): number[];
|
|
62
|
+
/** Outbound 후보 — Phase B2 balancing 정책에서 hops 동률 그룹 + target sink id 사용. */
|
|
63
|
+
export interface NextHopCandidate {
|
|
64
|
+
/** outbound port index (FlowGraphNode.topology.outbounds 의 index, = graph.out 의 index). */
|
|
65
|
+
index: number;
|
|
66
|
+
/** 이 outbound 의 *_가까운 sink_* 까지의 최단 hop 수 (자기 포함 = 1). */
|
|
67
|
+
hops: number;
|
|
68
|
+
/** 그 hop 의 *_가까운 sink id_* (동률 시 lexical first — 결정론). */
|
|
69
|
+
target: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* nextHopsToAny 의 *_상세 버전_* — index + hops + target sink id. balancing 정책이
|
|
73
|
+
* *_같은 hops 동률 그룹화_* + *_target sink 의 routingWeight 조회_* 등에 사용 (Phase B2).
|
|
74
|
+
*/
|
|
75
|
+
export declare function nextHopsToAnyDetailed(graph: FlowGraph, fromId: string, destIds: Iterable<string>): NextHopCandidate[];
|
|
76
|
+
//# sourceMappingURL=flow-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-graph.d.ts","sourceRoot":"","sources":["../../src/flow/flow-graph.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAkB,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAErH,wDAAwD;AACxD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,eAAe,CAAA;IACzB,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB;;;;;OAKG;IACH,KAAK,CAAC,EAAE;QACN,8BAA8B;QAC9B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;QACrB,8BAA8B;QAC9B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KACpB,CAAA;CACF;AAED,kBAAkB;AAClB,MAAM,WAAW,SAAS;IACxB,eAAe;IACf,KAAK,EAAE,GA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FAA2F;IAC3F,KAAK,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GACxB,gBAAgB,EAAE,CAwBpB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface DataScenario {
|
|
2
|
+
/** 이 시나리오의 carrier data — 경로의 모든 constraint AND merge. */
|
|
3
|
+
data: Record<string, any>;
|
|
4
|
+
/** sampling weight — default 1 (= 균등). 향후 demand-driven 등 확장. */
|
|
5
|
+
weight: number;
|
|
6
|
+
/** debug — 경로의 segment id 들. */
|
|
7
|
+
pathIds?: string[];
|
|
8
|
+
/**
|
|
9
|
+
* 경로의 *종착 sink id* (= carrier 의 최종 목적지). generator 가 carrier.meta.
|
|
10
|
+
* destination 에 주입 → 분기점이 목적지 지향 next-hop 라우팅(flow-graph.canReach)
|
|
11
|
+
* 으로 분기하게 될 토대. 미상이면 undefined (= 목적지 없는 carrier).
|
|
12
|
+
*/
|
|
13
|
+
destination?: string;
|
|
14
|
+
}
|
|
15
|
+
interface SegmentLike {
|
|
16
|
+
state?: {
|
|
17
|
+
id?: string;
|
|
18
|
+
};
|
|
19
|
+
parent?: any;
|
|
20
|
+
rootModel?: any;
|
|
21
|
+
root?: any;
|
|
22
|
+
getSegmentTopology?: () => any;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 생성기 (= source) 부터 BFS — RoutingCapability 의 constraints 누적 + sink 도달
|
|
26
|
+
* 시 시나리오 추가. 결과: 가능 data 시나리오 list.
|
|
27
|
+
*
|
|
28
|
+
* @returns 데이터 시나리오 list (균등 weight). 빈 list = downstream 추론 실패.
|
|
29
|
+
*/
|
|
30
|
+
export declare function enumerateDataScenarios(source: SegmentLike, maxDepth?: number): DataScenario[];
|
|
31
|
+
/**
|
|
32
|
+
* AND merge — 두 constraint 의 key-value 합치기. key 충돌 (= 다른 value) 시 null.
|
|
33
|
+
*/
|
|
34
|
+
export declare function mergeConstraints(base: Record<string, any>, add: Record<string, any>): Record<string, any> | null;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=flow-introspection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-introspection.d.ts","sourceRoot":"","sources":["../../src/flow/flow-introspection.ts"],"names":[],"mappings":"AAoCA,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,kBAAkB,CAAC,EAAE,MAAM,GAAG,CAAA;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,WAAW,EACnB,QAAQ,SAAK,GACZ,YAAY,EAAE,CAmGhB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACvB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAO5B"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type Component from '../components/component.js';
|
|
2
|
+
type Constructor<T = {}> = new (...args: any[]) => T;
|
|
3
|
+
/** 3D position. */
|
|
4
|
+
export type Vec3 = {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
z: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Port — flow graph 의 edge endpoint (inbound / outbound).
|
|
11
|
+
* 그래프 측 routing / FlowEngine 이 활용.
|
|
12
|
+
*/
|
|
13
|
+
export interface Port {
|
|
14
|
+
/** Port id (node 안 유일). */
|
|
15
|
+
id: string;
|
|
16
|
+
/** 위치 (node-local). 도메인 측 routing / 시각화 활용. */
|
|
17
|
+
position?: Vec3;
|
|
18
|
+
/** 진행 방향 (node-local). 그래프 측 tangent. */
|
|
19
|
+
direction?: Vec3;
|
|
20
|
+
/** 도메인 메타데이터 (label / capability tag 등). */
|
|
21
|
+
meta?: Record<string, any>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* SlotInfo — node 안 세분 위치 (slot / cell 등).
|
|
25
|
+
*
|
|
26
|
+
* 3 capability 가 query 로 활용:
|
|
27
|
+
* - Dwellable.attachPointFor(item, { slotId }) — slot.attach 활용
|
|
28
|
+
* - Transferable.receive(item, { slotId }) — slot 별 receive
|
|
29
|
+
* - Operable.transform(inputs, outputs, { slotId }) — slot 별 변화
|
|
30
|
+
*/
|
|
31
|
+
export interface SlotInfo {
|
|
32
|
+
/** node-local 위치. */
|
|
33
|
+
position: Vec3;
|
|
34
|
+
/** node-local size (옵션). */
|
|
35
|
+
size?: {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
depth: number;
|
|
39
|
+
};
|
|
40
|
+
/** 3D scene-graph attach point (옵션). holder 의 _realObject 자손 object3d. */
|
|
41
|
+
attach?: any;
|
|
42
|
+
/** 도메인 메타데이터. */
|
|
43
|
+
meta?: Record<string, any>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* FlowNode capability — flow graph 의 노드 (구조 + flow). 보유는 Holdable 위임.
|
|
47
|
+
*
|
|
48
|
+
* 모든 자식 (Transferable / Dwellable / Operable) 의 base. Dwellable 적용 안 한 node
|
|
49
|
+
* 도 Holdable 로 _items 사용 가능 — 정책 (capacity 등) 만 추가 layer.
|
|
50
|
+
*
|
|
51
|
+
* Phase D-4 (2026-06-20): ItemsDataBinding 자동 합류 — 모든 FlowNode 자손이
|
|
52
|
+
* `holder.data` 표준 entry 자동 보유.
|
|
53
|
+
*/
|
|
54
|
+
export default function FlowNode<T extends Constructor<Component>>(superclass: T): any;
|
|
55
|
+
/** Type guard. */
|
|
56
|
+
export declare function isFlowNode(c: any): c is {
|
|
57
|
+
isFlowNode: true;
|
|
58
|
+
inboundPorts(): Port[];
|
|
59
|
+
outboundPorts(): Port[];
|
|
60
|
+
slotIds?(): string[];
|
|
61
|
+
slotAt?(slotId: string): SlotInfo | null;
|
|
62
|
+
_items: any[];
|
|
63
|
+
addItem: (h: any, o?: any) => void;
|
|
64
|
+
removeItem: (h: any, silent?: boolean) => void;
|
|
65
|
+
handoverIn: (c: any, o?: any) => void;
|
|
66
|
+
handoverOut: (c: any) => void;
|
|
67
|
+
};
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=flow-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-node.d.ts","sourceRoot":"","sources":["../../src/flow/flow-node.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAA;AA0BvD,KAAK,WAAW,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AAEpD,mBAAmB;AACnB,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB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AK,IAAI,CAAA;IAC9C,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IACrC,WAAW,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;CAC9B,CAEA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FlowDir } from './flow-orientation.js';
|
|
2
|
+
/** 트리에서 segment/anchor/hub 수집 → 흐름 방향 map. */
|
|
3
|
+
export declare function computeFlowMap(root: any): Map<string, FlowDir>;
|
|
4
|
+
/**
|
|
5
|
+
* 컨베이어가 자기 흐름 방향(reverse 여부)을 조회 — getSegmentTopology 에서 호출.
|
|
6
|
+
* true=reverse, false=forward, undefined=미결정(override 안 함, 수동값 유지).
|
|
7
|
+
*
|
|
8
|
+
* 흐름 방향은 *정적 레이아웃의 함수*라 시뮬 중엔 안 바뀐다 → root 당 *1회*만 computeFlowMap
|
|
9
|
+
* 하고 캐시 (per-call 전체 트리 스캔 제거 = 성능 핵심). 첫 조회는 모델 빌드 완료 후 발생하고,
|
|
10
|
+
* 모델 재로드 시 root(model_layer)가 새로 생겨 캐시도 자연히 비므로 별도 무효화 불필요.
|
|
11
|
+
*/
|
|
12
|
+
export declare function flowReverseFor(self: any): boolean | undefined;
|
|
13
|
+
//# sourceMappingURL=flow-orientation-coordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-orientation-coordinator.d.ts","sourceRoot":"","sources":["../../src/flow/flow-orientation-coordinator.ts"],"names":[],"mappings":"AAoBA,OAAO,EAA+D,KAAK,OAAO,EAAa,MAAM,uBAAuB,CAAA;AAuC5H,8CAA8C;AAC9C,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAkF9D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,GAAG,SAAS,CAkB7D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface Vec2 {
|
|
2
|
+
x: number;
|
|
3
|
+
z: number;
|
|
4
|
+
}
|
|
5
|
+
/** 방향 추론 대상 segment — start→end 가 intrinsic forward. */
|
|
6
|
+
export interface FlowSegmentInput {
|
|
7
|
+
id: string;
|
|
8
|
+
start: Vec2;
|
|
9
|
+
end: Vec2;
|
|
10
|
+
}
|
|
11
|
+
/** 방향 기준점 — 연결 지점(세그먼트 끝점과 매칭)에서의 소스/싱크. */
|
|
12
|
+
export interface FlowAnchor {
|
|
13
|
+
pos: Vec2;
|
|
14
|
+
/** 'source' = 여기서 흘려보냄(연결 세그먼트의 진입), 'sink' = 여기로 빨아들임(진출). */
|
|
15
|
+
kind: 'source' | 'sink';
|
|
16
|
+
}
|
|
17
|
+
/** forward = start→end, reverse = end→start, unknown = 미결정(anchor 미도달). */
|
|
18
|
+
export type FlowDir = 'forward' | 'reverse' | 'unknown';
|
|
19
|
+
export interface FlowResult {
|
|
20
|
+
/** segment id → 흐름 방향. */
|
|
21
|
+
directions: Map<string, FlowDir>;
|
|
22
|
+
/** anchor 불일치로 충돌한 segment id 들. */
|
|
23
|
+
conflicts: string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 연결된 segment 들의 흐름 방향을 anchor 에서 전파해 추론.
|
|
27
|
+
* @param tolerance 끝점 일치(연결) 판정 거리 (scene unit). default 5.
|
|
28
|
+
* @param hubs joint 처럼 *여러 컨베이어를 잇는 허브* — 한 그룹의 위치들은 단일
|
|
29
|
+
* 연결점으로 병합돼 그 사이로 흐름이 전파/보존된다 (2-way joint=통과, 3+=분기).
|
|
30
|
+
* @param anchorTolerance anchor(소스/싱크)→세그먼트 끝점 매칭 거리. 소스(generator)는
|
|
31
|
+
* 컨베이어와 *면 overlap*(~halfSpan) 으로 연결돼 점거리가 클 수 있어 endpoint
|
|
32
|
+
* 클러스터(tolerance)보다 넉넉해야 한다. default = tolerance.
|
|
33
|
+
*/
|
|
34
|
+
/** hub 입력 — 위치 그룹(기존) 또는 source/sink 성격을 가진 hub.
|
|
35
|
+
* kind 'sink' = drain(연결 세그먼트 모두 hub 로 흘러듦), 'source' = spring(모두 나감).
|
|
36
|
+
* joint 가 chute(sink)/generator(source) 를 footprint 에 품으면 그 kind 로 표시. */
|
|
37
|
+
export type FlowHub = ReadonlyArray<Vec2> | {
|
|
38
|
+
positions: ReadonlyArray<Vec2>;
|
|
39
|
+
kind?: 'source' | 'sink';
|
|
40
|
+
};
|
|
41
|
+
export declare function inferFlowDirections(segments: ReadonlyArray<FlowSegmentInput>, anchors: ReadonlyArray<FlowAnchor>, tolerance?: number, hubs?: ReadonlyArray<FlowHub>, anchorTolerance?: number): FlowResult;
|
|
42
|
+
//# sourceMappingURL=flow-orientation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-orientation.d.ts","sourceRoot":"","sources":["../../src/flow/flow-orientation.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,wDAAwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,IAAI,CAAA;IACX,GAAG,EAAE,IAAI,CAAA;CACV;AAED,4CAA4C;AAC5C,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,IAAI,CAAA;IACT,+DAA+D;IAC/D,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;CACxB;AAED,2EAA2E;AAC3E,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;AAEvD,MAAM,WAAW,UAAU;IACzB,0BAA0B;IAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,oCAAoC;IACpC,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB;AAMD;;;;;;;;GAQG;AACH;;2EAE2E;AAC3E,MAAM,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG;IAAE,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;CAAE,CAAA;AAExG,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,aAAa,CAAC,gBAAgB,CAAC,EACzC,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,EAClC,SAAS,SAAI,EACb,IAAI,GAAE,aAAa,CAAC,OAAO,CAAM,EACjC,eAAe,SAAY,GAC1B,UAAU,CAyPZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-trace.d.ts","sourceRoot":"","sources":["../../src/flow/flow-trace.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,QAAQ,CAAA;AAK/B,wBAAgB,MAAM,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAM/C;AAED,8CAA8C;AAC9C,wBAAgB,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAEnC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { anchorsConnect, deliversInto, matchOutbounds, pointInRotatedRect, rayAbsDistanceToRect, straightSegmentTopology, straightSegmentEndpoints, arcSegmentTopology, straightSegmentMultiInbound, type Anchor2D, type SegmentTopology, type SegmentBounds, type MatchTolerance } from './segment-topology.js';
|
|
2
|
+
export { rectFaceAnchors, type FaceAnchor } from './face-anchors.js';
|
|
3
|
+
export { buildFlowGraph, nextHops, nextHop, nextHopsToAny, nextHopsToAnyDetailed, canReach, reachableSinks, reachableByOutbound, type FlowGraph, type FlowGraphNode, type NextHopCandidate } from './flow-graph.js';
|
|
4
|
+
export { validate as validateFlowGraph } from './flow-graph-validator.js';
|
|
5
|
+
export type { IssueSeverity, IssueCode, ValidateOptions, FlowGraphIssue } from './flow-graph-validator.js';
|
|
6
|
+
export { inferDownstreamId, collectAdjacentSegments } from './auto-route.js';
|
|
7
|
+
export { enumerateDataScenarios, type DataScenario } from './flow-introspection.js';
|
|
8
|
+
export { inferFlowDirections, type FlowAnchor, type FlowSegmentInput, type FlowDir, type Vec2 } from './flow-orientation.js';
|
|
9
|
+
export { computeFlowMap, flowReverseFor } from './flow-orientation-coordinator.js';
|
|
10
|
+
export { ftrace, ftId } from './flow-trace.js';
|
|
11
|
+
export { next, downstream, reachableDestinations, reachableDestinationsFrom, reachableDestinationsWeightedFrom, pickWeightedDestination, graphFor, validate, FlowEngine, type RoutingResult, type WeightedDestination } from './flow-engine.js';
|
|
12
|
+
export { flowGraphFor, resolveNextHop, flowGraphIssues, sinksForDestination, componentForNode, nodeIdOf, allDestinations, applyPolicy, isRoutingTarget, type RoutingTarget, type BalancingPolicy, type BalancingState } from './flow-graph-coordinator.js';
|
|
13
|
+
export { findNearestStationHost, isStationHost, type StationHostCandidate } from './station-host-inference.js';
|
|
14
|
+
export { default as FlowNode, isFlowNode } from './flow-node.js';
|
|
15
|
+
export type { Port, SlotInfo, Vec3 } from './flow-node.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/flow/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGpE,OAAO,EACL,cAAc,EACd,QAAQ,EACR,OAAO,EACP,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,mBAA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AAI,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { rectFaceAnchors } from './face-anchors.js';
|
|
2
|
+
export { rectFaceAnchors };
|
|
3
|
+
/** XZ 평면 vector (= scene world 좌표의 X/Z, Y 는 floor-level 무시). */
|
|
4
|
+
export interface Anchor2D {
|
|
5
|
+
/** scene world position (x = state.left + offset, z = state.top + offset). */
|
|
6
|
+
worldPos: {
|
|
7
|
+
x: number;
|
|
8
|
+
z: number;
|
|
9
|
+
};
|
|
10
|
+
/** 진행 방향 단위 vector (carrier 의 속도 vector 와 일치). */
|
|
11
|
+
direction: {
|
|
12
|
+
x: number;
|
|
13
|
+
z: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* 면(face) 의 절반 길이 — anchor 가 *면* 에서 유래한 경우. anchorsConnect 가
|
|
17
|
+
* 접선 방향 판정을 중심 거리 근사가 아닌 *면 segment 겹침* 으로 수행하는 데
|
|
18
|
+
* 사용. 미지정 (점 anchor) 시 기존 중심 거리 판정 fallback.
|
|
19
|
+
*/
|
|
20
|
+
halfSpan?: number;
|
|
21
|
+
}
|
|
22
|
+
/** Segment 의 입출구 anchor 들. inbound/outbound 각 1개 이상. */
|
|
23
|
+
export interface SegmentTopology {
|
|
24
|
+
/** 입구 anchor 들. carrier 가 들어올 수 있는 면. 미구현 segment = 빈 배열. */
|
|
25
|
+
inbounds: Anchor2D[];
|
|
26
|
+
/** 출구 anchor 들. carrier 가 나갈 수 있는 면. 미구현 segment = 빈 배열. */
|
|
27
|
+
outbounds: Anchor2D[];
|
|
28
|
+
}
|
|
29
|
+
/** Anchor 매칭 tolerance (= 자동 연결 판정 기준). */
|
|
30
|
+
export interface MatchTolerance {
|
|
31
|
+
/** 좌표 distance 임계 (scene unit). default 5. */
|
|
32
|
+
distance?: number;
|
|
33
|
+
/** 방향 dot product 임계 (= cosine). 1 = 완전 일치, 0.95 ≈ 18° 이내. default 0.9. */
|
|
34
|
+
cosine?: number;
|
|
35
|
+
/** sink(outbound 없는 종착: StockPile/Dock 등) footprint-배달 margin. default 30 —
|
|
36
|
+
* 딱 안 붙어도 인접하면 자동링크. 흐름연속 후보는 영향 없음(6 고정). */
|
|
37
|
+
sinkMargin?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* State 기반 *_straight segment_* 의 topology. 가장 흔한 케이스 — Conveyor /
|
|
41
|
+
* cross-belt-line / induct-station 등. orientation 자동 추정 (horizontal /
|
|
42
|
+
* vertical / auto by aspect).
|
|
43
|
+
*
|
|
44
|
+
* 가정:
|
|
45
|
+
* - state.left/top = 좌상단, width/height = 크기
|
|
46
|
+
* - rotation = 중심 기준 회전 (radian, CW positive — things-scene 표준)
|
|
47
|
+
* - 흐름 방향 = *_긴 축_* (orientation auto 시 width vs height 비교)
|
|
48
|
+
* - status='reverse' 시 흐름 반대 (= inbound/outbound swap)
|
|
49
|
+
*
|
|
50
|
+
* 결과:
|
|
51
|
+
* - inbound = 시작 짧은 면의 중앙
|
|
52
|
+
* - outbound = 끝 짧은 면의 중앙
|
|
53
|
+
* - direction = 시작 → 끝 단위 vector
|
|
54
|
+
*/
|
|
55
|
+
export declare function straightSegmentTopology(state: {
|
|
56
|
+
left?: number;
|
|
57
|
+
top?: number;
|
|
58
|
+
width?: number;
|
|
59
|
+
height?: number;
|
|
60
|
+
rotation?: number;
|
|
61
|
+
orientation?: 'horizontal' | 'vertical' | '';
|
|
62
|
+
status?: string;
|
|
63
|
+
}, reverseOverride?: boolean): SegmentTopology;
|
|
64
|
+
/**
|
|
65
|
+
* Straight segment 의 *기하 끝점* (start/end) — status/reverse 무관. flow-orientation
|
|
66
|
+
* 이 흐름 방향을 추론할 때 순환(현재 reverse 가 다음 추론에 영향) 을 피하려 *고정된*
|
|
67
|
+
* 기하 끝점이 필요. straightSegmentTopology 의 startPos/endPos 와 동일 좌표.
|
|
68
|
+
* 반환: { start, end } — start→end 가 intrinsic forward (reverse=false 일 때 흐름).
|
|
69
|
+
*/
|
|
70
|
+
export declare function straightSegmentEndpoints(state: {
|
|
71
|
+
left?: number;
|
|
72
|
+
top?: number;
|
|
73
|
+
width?: number;
|
|
74
|
+
height?: number;
|
|
75
|
+
rotation?: number;
|
|
76
|
+
orientation?: 'horizontal' | 'vertical' | '';
|
|
77
|
+
}): {
|
|
78
|
+
start: {
|
|
79
|
+
x: number;
|
|
80
|
+
z: number;
|
|
81
|
+
};
|
|
82
|
+
end: {
|
|
83
|
+
x: number;
|
|
84
|
+
z: number;
|
|
85
|
+
};
|
|
86
|
+
} | null;
|
|
87
|
+
/**
|
|
88
|
+
* Arc (curve) segment topology — cross-belt-curve / conveyor-join 같은 *_도넛
|
|
89
|
+
* 섹터_* segment. carrier 가 호 위를 따라 시작→끝 각도로 흐름.
|
|
90
|
+
*
|
|
91
|
+
* State shape (도넛 섹터):
|
|
92
|
+
* - cx, cy: 호 중심 (scene absolute 좌표)
|
|
93
|
+
* - rx, ry: 외측 반지름 (x/y 다름 = ellipse 호 가능)
|
|
94
|
+
* - ratio (0..100): 내측 반지름 비율 (innerRx = rx * ratio/100)
|
|
95
|
+
* - startAngle, endAngle: 시작/끝 각도 (radian, things-scene 컨벤션)
|
|
96
|
+
*
|
|
97
|
+
* 호 위 점 공식 (line 348 의 ConveyorJoin.controls 와 일치):
|
|
98
|
+
* P(θ) = (cx + r*sin(θ), cy - r*cos(θ))
|
|
99
|
+
* tangent (carrier 진행 방향) = (cos(θ), sin(θ))
|
|
100
|
+
*
|
|
101
|
+
* Anchor:
|
|
102
|
+
* - inbound at startAngle: midR 거리 + 진행 방향 (= θ 증가 방향)
|
|
103
|
+
* - outbound at endAngle: midR 거리 + 진행 방향
|
|
104
|
+
* - reverse 시 swap + direction 반전
|
|
105
|
+
*/
|
|
106
|
+
export declare function arcSegmentTopology(state: {
|
|
107
|
+
cx?: number;
|
|
108
|
+
cy?: number;
|
|
109
|
+
rx?: number;
|
|
110
|
+
ry?: number;
|
|
111
|
+
ratio?: number;
|
|
112
|
+
startAngle?: number;
|
|
113
|
+
endAngle?: number;
|
|
114
|
+
status?: string;
|
|
115
|
+
}): SegmentTopology;
|
|
116
|
+
/**
|
|
117
|
+
* Multi-inbound straight segment — 합류 (merger) 의 토대. 흐름축은 그대로 (1
|
|
118
|
+
* outbound 한 면) 인데, *_나머지 모든 면이 inbound_* (= 어느 옆 conveyor 가
|
|
119
|
+
* 와도 합류 가능).
|
|
120
|
+
*
|
|
121
|
+
* - outbounds = straightSegmentTopology(state).outbounds (= 1 face)
|
|
122
|
+
* - inbounds = 직교 (흐름축 시작 + 양 perpendicular) + 측면 사선 (45° 전진 편향)
|
|
123
|
+
*
|
|
124
|
+
* 사선 anchor — 실물 merger 는 양쪽에서 *사선* 으로 모이는 Y자 합류가 통상.
|
|
125
|
+
* 측면 (흐름과 perpendicular) inbound 마다 본선 진행방향으로 45° 기운 anchor 를
|
|
126
|
+
* 추가 선언 — 회전시킨 일반 conveyor 가 비스듬히 닿으면 자동 연결 (새 컴포넌트
|
|
127
|
+
* 불요). 가로 본선 기준 top 면은 ↘, bottom 면은 ↗ 로 자연 분리돼 양쪽 사선
|
|
128
|
+
* 합류가 성립. 직교 anchor 보존 (직교 합류도 유효).
|
|
129
|
+
*
|
|
130
|
+
* Direction 검사 가 *_같은 방향만 매칭_* 보장 — 옆 conveyor 가 방향 일치
|
|
131
|
+
* (직교 또는 사선) 시에만 자동 매칭. 의도 안 한 합류 차단.
|
|
132
|
+
*/
|
|
133
|
+
export declare function straightSegmentMultiInbound(state: {
|
|
134
|
+
left?: number;
|
|
135
|
+
top?: number;
|
|
136
|
+
width?: number;
|
|
137
|
+
height?: number;
|
|
138
|
+
rotation?: number;
|
|
139
|
+
orientation?: 'horizontal' | 'vertical' | '';
|
|
140
|
+
status?: string;
|
|
141
|
+
}): SegmentTopology;
|
|
142
|
+
/**
|
|
143
|
+
* 두 anchor 가 연결 가능한지 (= 자동 routing 후보). A 의 outbound 가 B 의
|
|
144
|
+
* inbound 와 *_위치 + 방향_* 일치하면 true.
|
|
145
|
+
*
|
|
146
|
+
* - 위치: distance <= tolerance.distance
|
|
147
|
+
* - 방향: outbound.direction · inbound.direction >= tolerance.cosine
|
|
148
|
+
* (둘 다 *_carrier 의 진행 방향_*이므로 같은 방향이어야 함)
|
|
149
|
+
*/
|
|
150
|
+
export declare function anchorsConnect(out: Anchor2D, inn: Anchor2D, tolerance?: MatchTolerance): boolean;
|
|
151
|
+
/** 컴포넌트의 board footprint (rotation 포함). matchOutbounds 의 배달 판정용. */
|
|
152
|
+
export interface SegmentBounds {
|
|
153
|
+
left?: number;
|
|
154
|
+
top?: number;
|
|
155
|
+
width?: number;
|
|
156
|
+
height?: number;
|
|
157
|
+
rotation?: number;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* 점 (px, pz) 가 회전된 사각 footprint 안인지 — margin 만큼 확장.
|
|
161
|
+
* board (x = left, z = top) 좌표계.
|
|
162
|
+
*/
|
|
163
|
+
export declare function pointInRotatedRect(px: number, pz: number, b: SegmentBounds, margin?: number): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Ray-rectangle 절대값 거리 — chute 출구점을 통과하는 face normal 의 *_양방향 직선_*
|
|
166
|
+
* 과 사각형의 가장 가까운 교점까지 거리. 광선이 사각형 안에서 출발하면 (겹침) 가까운
|
|
167
|
+
* face 쪽 거리. 교차 없으면 Infinity.
|
|
168
|
+
*
|
|
169
|
+
* # 왜 이 metric 인가 (2026-06-17 사용자 통찰)
|
|
170
|
+
*
|
|
171
|
+
* 이전 matchOutbounds 의 ② 단계 tie-break = *_chute 출구점 ↔ stockpile center 의 유클리드
|
|
172
|
+
* 거리_*. 단점:
|
|
173
|
+
* - 큰 stockpile 의 center 가 *_chute face 와 평행하지만 멀게_* 측정됨
|
|
174
|
+
* - chute 가 *_정면으로_* 향한 stockpile 이 *_center 가 우연히 가까운_* 다른 sink 에 밀림
|
|
175
|
+
*
|
|
176
|
+
* 직교거리 (face normal 방향 ray cast) 가 *_물리적으로 자연_*:
|
|
177
|
+
* - "chute 가 정면으로 가까운 face" 가 정확히 측정됨
|
|
178
|
+
* - 큰 stockpile 의 긴 face 가 *_chute face 와 평행_* 일 때 hit 거리 짧음
|
|
179
|
+
* - 컴포넌트 center 위치와 무관 — center 왜곡 제거
|
|
180
|
+
*
|
|
181
|
+
* # 절대값 (양방향) 이유
|
|
182
|
+
* chute 출구점이 stockpile 영역 안 (겹침) 인 경우도 자연스럽게 처리. 정방향 hit 가 더 멀어도
|
|
183
|
+
* 역방향에 더 가까운 face 가 있으면 그 거리. 진행 방향 의존성 제거.
|
|
184
|
+
*/
|
|
185
|
+
export declare function rayAbsDistanceToRect(origin: {
|
|
186
|
+
x: number;
|
|
187
|
+
z: number;
|
|
188
|
+
}, direction: {
|
|
189
|
+
x: number;
|
|
190
|
+
z: number;
|
|
191
|
+
}, rect: SegmentBounds): number;
|
|
192
|
+
/**
|
|
193
|
+
* source 배출 anchor 가 target footprint 로 *배달* 되는지 — anchor 끝-끝
|
|
194
|
+
* 매칭의 보완. 사용자가 컴포넌트를 (회전·겹침 포함) 손으로 놓아 배출 끝점이
|
|
195
|
+
* 상대 입구를 파고들어도 (= 겹침) 자동 연결되도록.
|
|
196
|
+
*
|
|
197
|
+
* - 끝점이 footprint 안 (+ margin) — 물리적으로 들이밀고 있음
|
|
198
|
+
* - 방향이 전진 호환 — candidateFlow (target 흐름) 와 dot ≥ 0 (역류 차단).
|
|
199
|
+
* flow 없으면 (sink) footprint 중심을 향하는지로 대체.
|
|
200
|
+
*
|
|
201
|
+
* 끝-끝 정밀 매칭 (anchorsConnect) 의 거리 tolerance(5) 가 hand-place 겹침
|
|
202
|
+
* (10~25 unit) 을 갭으로 거부하던 결함 보완 (2026-06-08 보고).
|
|
203
|
+
*/
|
|
204
|
+
export declare function deliversInto(out: Anchor2D, bounds: SegmentBounds, candidateFlow?: {
|
|
205
|
+
x: number;
|
|
206
|
+
z: number;
|
|
207
|
+
}, margin?: number): boolean;
|
|
208
|
+
/**
|
|
209
|
+
* 자기 outbound 각각에 대해 *_연결 가능한 인근 segment_* 의 id 를 매칭.
|
|
210
|
+
*
|
|
211
|
+
* - candidates: scene 안 모든 segment (자기 자신 제외). 각 항목은
|
|
212
|
+
* { id, topology } — pure helper 라 component 객체가 아닌 추출 정보만.
|
|
213
|
+
* - 결과: outbound index → matched candidate id (또는 null). 자기 outbound
|
|
214
|
+
* 수 만큼.
|
|
215
|
+
*
|
|
216
|
+
* 매칭 우선순위:
|
|
217
|
+
* - 정확 일치 후보가 여럿이면 *_가장 가까운 worldPos_*.
|
|
218
|
+
* - 그래도 동률이면 id 사전순 (결정성).
|
|
219
|
+
*/
|
|
220
|
+
export declare function matchOutbounds(selfTopology: SegmentTopology, candidates: ReadonlyArray<{
|
|
221
|
+
id: string;
|
|
222
|
+
topology: SegmentTopology;
|
|
223
|
+
bounds?: SegmentBounds;
|
|
224
|
+
}>, tolerance?: MatchTolerance): Array<string | null>;
|
|
225
|
+
//# sourceMappingURL=segment-topology.d.ts.map
|