compile ok .ㅠㅠ

This commit is contained in:
chi
2025-05-26 10:21:17 +09:00
parent 57dc6de740
commit 77a6aefb44
27 changed files with 780 additions and 204 deletions

View File

@@ -0,0 +1,70 @@
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<Point> CurrentPath { get; set; }
public List<Point> PlannedPath { get; set; }
public List<string> PathRFIDs { get; set; }
public AGV()
{
CurrentPath = new List<Point>();
PlannedPath = new List<Point>();
PathRFIDs = new List<string>();
CurrentDirection = Direction.Forward;
}
public void Move()
{
if (CurrentPath.Count > 0)
{
CurrentPosition = CurrentPath[0];
CurrentPath.RemoveAt(0);
}
}
public void SetNewPath(List<Point> path)
{
CurrentPath = new List<Point>(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;
}
}
}