using System.Drawing;
using System.Collections.Generic;
using System.Linq;
namespace AGVControl.Models
{
public class AGV
{
public Point CurrentPosition { get; set; }
public uint CurrentRFID { get; set; }
public float BatteryLevel { get; set; } = 0f;
///
/// AGV에서 방향값이 수산됩니다.
///
public Direction CurrentDirection { get; set; }
///
/// 현재위치가 수산되면 목적지까지의 방향값이 계산됩니다.
///
public Direction TargetDirection { get; set; }
public bool IsMoving { get; set; }
public List CurrentPath { get; set; }
public List PlannedPath { get; set; }
public List PathRFIDs { get; set; }
public Point TargetPosition { get; set; }
public uint TargetRFID { get; set; }
public AGV()
{
CurrentPath = new List();
PlannedPath = new List();
PathRFIDs = new List();
CurrentDirection = Direction.Forward;
TargetPosition = Point.Empty;
TargetRFID = 0;
TargetDirection = Direction.Forward;
}
public void Move()
{
if (CurrentPath.Count > 0)
{
CurrentPosition = CurrentPath[0];
CurrentPath.RemoveAt(0);
}
}
}
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;
}
}
}