Skip to content

feat(core): ルートデータモデルの拡張 — auto/manual区別とルーティングメタデータ #31

@konoe-akitoshi

Description

@konoe-akitoshi

概要

エッジルーティングシステムの刷新に向けて、LayoutLink および関連型にルーティングメタデータを追加する。手動配線・自動配線の両方を同一データモデルで表現できるようにする。

背景

現在の LayoutLink.pointsPosition[] のみで、ルーティングの由来(auto/manual)やセグメント種別(直線/斜め/円弧)の情報を持たない。今後のルーティングシステム分離・手動配線対応の土台として、データモデルの拡張が必要。

設計

1. RouteSegment 型の導入

export type RouteSegmentType = 'line' | 'arc'

export interface RouteSegment {
  /** セグメント種別 */
  type: RouteSegmentType
  /** 終点座標 (始点は前セグメントの終点 or route.start) */
  end: Position
  /** arc の場合の制御点 */
  controlPoint?: Position
}

2. Route 型の導入

export type RouteType = 'auto' | 'manual'

export interface Route {
  /** ルーティングの由来 */
  type: RouteType
  /** 経路の始点 */
  start: Position
  /** セグメント列 */
  segments: RouteSegment[]
  /** 自動ルーティング時のアルゴリズム名 */
  algorithm?: string
}

3. LayoutLink の拡張

export interface LayoutLink {
  id: string
  from: string
  to: string
  fromEndpoint: LinkEndpoint
  toEndpoint: LinkEndpoint
  /** @deprecated route に移行。後方互換のため残す */
  points: Position[]
  /** 新しいルート表現 */
  route?: Route
  link: Link
}

4. YAML での手動ルート定義(将来)

links:
  - from: router1:eth0
    to: switch1:ge-0/0/0
    route:
      type: manual
      waypoints:
        - [100, 200]
        - [300, 200]
        - [300, 400]

タスク

  • RouteSegment, Route 型を models/types.ts に追加
  • LayoutLinkroute?: Route を追加
  • 既存の points から Route への変換ユーティリティ pointsToRoute() を作成
  • SVGレンダラーが route を優先して使うように変更(points フォールバック維持)
  • テスト追加

関連

  • #(次issue) エッジルーティングのELK分離
  • #(次issue) Visibility Graph Router
  • #(次issue) 手動ルーティング対応

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions