using System.Drawing; using System.Collections.Generic; using System.Linq; namespace AGVControl.Models { public class AGV { public Point CurrentPosition { get; set; } public string CurrentRFID { get; set; } public Direction CurrentDirection { get; set; } public bool IsMoving { get; set; } public List CurrentPath { get; set; } public List PlannedPath { get; set; } public List PathRFIDs { get; set; } public AGV() { CurrentPath = new List(); PlannedPath = new List(); PathRFIDs = new List(); CurrentDirection = Direction.Forward; } public void Move() { if (CurrentPath.Count > 0) { CurrentPosition = CurrentPath[0]; CurrentPath.RemoveAt(0); } } public void SetNewPath(List path) { CurrentPath = new List(path); } public void ClearPlannedPath() { PlannedPath.Clear(); PathRFIDs.Clear(); } } public enum Direction { Forward, Backward } public class PathNode { public Point Location { get; set; } public string RFID { get; set; } public double G { get; set; } // 시작점에서 현재 노드까지의 비용 public double H { get; set; } // 현재 노드에서 목표점까지의 예상 비용 public double F => G + H; // 총 비용 public PathNode Parent { get; set; } public PathNode(Point location, string rfid) { Location = location; RFID = rfid; G = 0; H = 0; Parent = null; } } }