Add venue planner: OOP furniture, shapes, conditions, room/birds-eye UI, layout+optimize modes, pathfinding, random search + NN stub
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
export type ShapeType = 'rectangle' | 'circle' | 'polygon';
|
||||
|
||||
export interface Point {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface Size {
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
export interface Rect extends Point, Size {}
|
||||
|
||||
export interface ShapeData {
|
||||
type: ShapeType;
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
rotation?: number;
|
||||
points?: Point[];
|
||||
}
|
||||
|
||||
export type ConditionKind =
|
||||
| 'walk_to_and_sit'
|
||||
| 'around_open_area'
|
||||
| 'near_entrance'
|
||||
| 'not_blocking_path'
|
||||
| 'accessible'
|
||||
| 'open_circulation';
|
||||
|
||||
export interface ConditionSpec {
|
||||
kind: ConditionKind;
|
||||
weight: number;
|
||||
params?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface FurnitureConfig {
|
||||
id: string;
|
||||
name: string;
|
||||
shape: ShapeData;
|
||||
conditions: ConditionSpec[];
|
||||
color?: string;
|
||||
lockedForOptimization?: boolean;
|
||||
placed?: boolean;
|
||||
}
|
||||
|
||||
export interface Entrance {
|
||||
x: number;
|
||||
y: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
rotation?: number;
|
||||
}
|
||||
|
||||
export interface RoomConfig {
|
||||
width: number;
|
||||
height: number;
|
||||
gridSize?: number;
|
||||
}
|
||||
|
||||
export interface GridCell {
|
||||
x: number;
|
||||
y: number;
|
||||
walkable: boolean;
|
||||
}
|
||||
|
||||
export interface PathNode extends Point {
|
||||
g: number;
|
||||
h: number;
|
||||
f: number;
|
||||
parent?: PathNode;
|
||||
}
|
||||
|
||||
export interface AccessibilityResult {
|
||||
furnitureId: string;
|
||||
distanceFromEntrance: number | null;
|
||||
reachable: boolean;
|
||||
pathLength: number | null;
|
||||
}
|
||||
|
||||
export interface LayoutEvaluation {
|
||||
totalScore: number;
|
||||
conditionScores: Record<string, number>;
|
||||
accessibility: AccessibilityResult[];
|
||||
penalty: number;
|
||||
}
|
||||
|
||||
export interface LayoutState {
|
||||
room: RoomConfig;
|
||||
entrance: Entrance | null;
|
||||
furniture: FurnitureConfig[];
|
||||
}
|
||||
Reference in New Issue
Block a user