diff --git a/Assets/Configs.meta b/Assets/Configs.meta deleted file mode 100644 index c438ad9..0000000 --- a/Assets/Configs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: df58f75918cee2c48bb2986daa4c7f8d -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Configs/simulation_config.proto b/Assets/Configs/simulation_config.proto deleted file mode 100644 index 38b32ac..0000000 --- a/Assets/Configs/simulation_config.proto +++ /dev/null @@ -1,98 +0,0 @@ -syntax = "proto3"; - -package SimulationConfigProto; - -message ProtobufConfig { - double step_time = 1; - repeated MissileConfigProto missile_configs = 2; - repeated TargetConfigProto target_configs = 3; -} - -enum MissileTypeProto { - HYDRA_70 = 0; - MICROMISSILE = 1; -} - -enum TargetTypeProto { - DRONE = 0; - MISSILE = 1; -} - -enum ConfigColorProto { - BLUE = 0; - GREEN = 1; - RED = 2; -} - -enum LineStyleProto { - DOTTED = 0; - SOLID = 1; -} - -enum MarkerProto { - TRIANGLE_UP = 0; - TRIANGLE_DOWN = 1; - SQUARE = 2; -} - -enum SensorTypeProto { - IDEAL = 0; -} - -message Vector3Proto { - double x = 1; - double y = 2; - double z = 3; -} - -message InitialStateProto { - Vector3Proto position = 1; - Vector3Proto velocity = 2; -} - -message LaunchConfigProto { - double launch_time = 1; -} - -message SensorConfigProto { - SensorTypeProto type = 1; - double frequency = 2; -} - -message DynamicConfigProto { - LaunchConfigProto launch_config = 1; - SensorConfigProto sensor_config = 2; -} - -message PlottingConfigProto { - ConfigColorProto color = 1; - LineStyleProto linestyle = 2; - MarkerProto marker = 3; -} - -message SubmunitionAgentConfigProto { - MissileTypeProto missile_type = 1; - InitialStateProto initial_state = 2; - DynamicConfigProto dynamic_config = 3; - PlottingConfigProto plotting_config = 4; -} - -message SubmunitionsConfigProto { - int32 num_submunitions = 1; - LaunchConfigProto launch_config = 2; - SubmunitionAgentConfigProto agent_config = 3; -} - -message MissileConfigProto { - MissileTypeProto missile_type = 1; - InitialStateProto initial_state = 2; - DynamicConfigProto dynamic_config = 3; - PlottingConfigProto plotting_config = 4; - SubmunitionsConfigProto submunitions_config = 5; -} - -message TargetConfigProto { - TargetTypeProto target_type = 1; - InitialStateProto initial_state = 2; - PlottingConfigProto plotting_config = 3; -} \ No newline at end of file diff --git a/Assets/Configs/simulation_config.proto.meta b/Assets/Configs/simulation_config.proto.meta deleted file mode 100644 index 13938d6..0000000 --- a/Assets/Configs/simulation_config.proto.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a739996d4385c0f408a96e21ca42a239 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Assignment/Assignment.cs b/Assets/Scripts/Assignment/Assignment.cs index 03b0bb8..42c5382 100644 --- a/Assets/Scripts/Assignment/Assignment.cs +++ b/Assets/Scripts/Assignment/Assignment.cs @@ -2,18 +2,18 @@ using System; using System.Collections.Generic; using UnityEngine; -// The assignment class is an interface for assigning a target to each missile. +// The assignment class is an interface for assigning a threat to each missile. public interface IAssignment { // Assignment item type. // The first element corresponds to the missile index, and the second element - // corresponds to the target index. + // corresponds to the threat index. public struct AssignmentItem { public int MissileIndex; - public int TargetIndex; + public int ThreatIndex; - public AssignmentItem(int missileIndex, int targetIndex) { + public AssignmentItem(int missileIndex, int threatIndex) { MissileIndex = missileIndex; - TargetIndex = targetIndex; + ThreatIndex = threatIndex; } } @@ -34,13 +34,13 @@ public interface IAssignment { } // Get the list of active target indices. - protected static List GetActiveTargetIndices(List targets) { - List activeTargetIndices = new List(); - for (int targetIndex = 0; targetIndex < targets.Count; targetIndex++) { - if (!targets[targetIndex].IsHit()) { - activeTargetIndices.Add(targetIndex); + protected static List GetActiveThreatIndices(List threats) { + List activeThreatIndices = new List(); + for (int threatIndex = 0; threatIndex < threats.Count; threatIndex++) { + if (!threats[threatIndex].IsHit()) { + activeThreatIndices.Add(threatIndex); } } - return activeTargetIndices; + return activeThreatIndices; } } diff --git a/Assets/Scripts/Assignment/RoundRobinAssignment.cs b/Assets/Scripts/Assignment/RoundRobinAssignment.cs index d14050a..e6d3e29 100644 --- a/Assets/Scripts/Assignment/RoundRobinAssignment.cs +++ b/Assets/Scripts/Assignment/RoundRobinAssignment.cs @@ -17,19 +17,19 @@ public class RoundRobinAssignment : IAssignment { return assignments; } - List activeTargetIndices = IAssignment.GetActiveTargetIndices(targets); - if (activeTargetIndices.Count == 0) { + List activeThreatIndices = IAssignment.GetActiveThreatIndices(targets); + if (activeThreatIndices.Count == 0) { return assignments; } foreach (int missileIndex in assignableMissileIndices) { - int nextActiveTargetIndex = activeTargetIndices.FindIndex(index => index > prevTargetIndex); + int nextActiveTargetIndex = activeThreatIndices.FindIndex(index => index > prevTargetIndex); if (nextActiveTargetIndex == -1) { nextActiveTargetIndex = 0; } - int nextTargetIndex = activeTargetIndices[nextActiveTargetIndex]; + int nextTargetIndex = activeThreatIndices[nextActiveTargetIndex]; assignments.Add(new IAssignment.AssignmentItem(missileIndex, nextTargetIndex)); prevTargetIndex = nextTargetIndex; } diff --git a/Assets/Scripts/Assignment/ThreatAssignment.cs b/Assets/Scripts/Assignment/ThreatAssignment.cs index f3bf4d4..33eaf45 100644 --- a/Assets/Scripts/Assignment/ThreatAssignment.cs +++ b/Assets/Scripts/Assignment/ThreatAssignment.cs @@ -16,14 +16,14 @@ public class ThreatAssignment : IAssignment { return assignments; } - List activeTargetIndices = IAssignment.GetActiveTargetIndices(targets); - if (activeTargetIndices.Count == 0) { + List activeThreatIndices = IAssignment.GetActiveThreatIndices(targets); + if (activeThreatIndices.Count == 0) { return assignments; } Vector3 positionToDefend = Vector3.zero; List threatInfos = - CalculateThreatLevels(targets, activeTargetIndices, positionToDefend); + CalculateThreatLevels(targets, activeThreatIndices, positionToDefend); foreach (int missileIndex in assignableMissileIndices) { if (missiles[missileIndex].HasAssignedTarget()) @@ -54,11 +54,11 @@ public class ThreatAssignment : IAssignment { return assignments; } - private List CalculateThreatLevels(List targets, List activeTargetIndices, + private List CalculateThreatLevels(List targets, List activeThreatIndices, Vector3 missilesMeanPosition) { List threatInfos = new List(); - foreach (int targetIndex in activeTargetIndices) { + foreach (int targetIndex in activeThreatIndices) { Agent target = targets[targetIndex]; float distanceToMean = Vector3.Distance(target.transform.position, missilesMeanPosition); float velocityMagnitude = target.GetVelocity().magnitude; diff --git a/Assets/Scripts/Config/ConfigLoader.cs b/Assets/Scripts/Config/ConfigLoader.cs index 5dc323c..945f040 100644 --- a/Assets/Scripts/Config/ConfigLoader.cs +++ b/Assets/Scripts/Config/ConfigLoader.cs @@ -48,10 +48,10 @@ public static class ConfigLoader { PrintSwarmConfig(config.missile_swarm_configs[i], $"Missile Swarm {i + 1}"); } - Debug.Log("Target Swarm Configurations:"); + Debug.Log("Threat Swarm Configurations:"); for (int i = 0; i < config.target_swarm_configs.Count; i++) { - PrintSwarmConfig(config.target_swarm_configs[i], $"Target Swarm {i + 1}"); + PrintSwarmConfig(config.target_swarm_configs[i], $"Threat Swarm {i + 1}"); } } @@ -66,7 +66,7 @@ public static class ConfigLoader { { Debug.Log(" Agent Configuration:"); Debug.Log($" Missile Type: {agentConfig.missile_type}"); - Debug.Log($" Target Type: {agentConfig.target_type}"); + Debug.Log($" Threat Type: {agentConfig.target_type}"); PrintInitialState(agentConfig.initial_state); PrintStandardDeviation(agentConfig.standard_deviation); PrintDynamicConfig(agentConfig.dynamic_config); diff --git a/Assets/Scripts/Config/SimulationConfig.cs b/Assets/Scripts/Config/SimulationConfig.cs index 7fa87a2..8ffa841 100644 --- a/Assets/Scripts/Config/SimulationConfig.cs +++ b/Assets/Scripts/Config/SimulationConfig.cs @@ -13,7 +13,7 @@ public class SimulationConfig { [Header("Missile Swarm Configurations")] public List missile_swarm_configs = new List(); - [Header("Target Swarm Configurations")] + [Header("Threat Swarm Configurations")] public List target_swarm_configs = new List(); } @@ -32,7 +32,7 @@ public class SwarmConfig { [Serializable] public class AgentConfig { public MissileType missile_type; - public TargetType target_type; + public ThreatType target_type; public InitialState initial_state; public StandardDeviation standard_deviation; public DynamicConfig dynamic_config; @@ -47,7 +47,7 @@ public class AgentConfig { dynamic_config = submunitionConfig.dynamic_config, plotting_config = submunitionConfig.plotting_config, // Set other fields as needed, using default values if not present in SubmunitionAgentConfig - target_type = TargetType.DRONE, // Or another default value + target_type = ThreatType.DRONE, // Or another default value submunitions_config = null // Or a default value if needed }; } @@ -102,7 +102,7 @@ public class SensorConfig { [Serializable] public class TargetConfig { - public TargetType target_type; + public ThreatType target_type; public InitialState initial_state; public PlottingConfig plotting_config; public string prefabName; @@ -112,7 +112,7 @@ public class TargetConfig { [JsonConverter(typeof(StringEnumConverter))] public enum MissileType { HYDRA_70, MICROMISSILE } [JsonConverter(typeof(StringEnumConverter))] -public enum TargetType { DRONE, MISSILE } +public enum ThreatType { DRONE, MISSILE } [JsonConverter(typeof(StringEnumConverter))] public enum ConfigColor { BLUE, GREEN, RED } [JsonConverter(typeof(StringEnumConverter))] diff --git a/Assets/Scripts/IADS/IADS.cs b/Assets/Scripts/IADS/IADS.cs index 362163f..07e2dd0 100644 --- a/Assets/Scripts/IADS/IADS.cs +++ b/Assets/Scripts/IADS/IADS.cs @@ -7,24 +7,24 @@ using System; public class IADS : MonoBehaviour { public enum TargetStatus { UNASSIGNED, ASSIGNED, HIT, DEGRADED, DESTROYED } - // Look up target status by unique target ID + // Look up threat status by unique threat ID public Dictionary _targetStatusDictionary; - private List _targets; + private List _threats; private List _missiles; private List _vessels; - public delegate void RegisterNewTargetDelegate(Target target); + public delegate void RegisterNewTargetDelegate(Threat threat); public event RegisterNewTargetDelegate OnRegisterNewTarget; void Start() { - _targets = new List(); + _threats = new List(); } - public void RegisterNewTarget(Target target) { - _targets.Add(target); - OnRegisterNewTarget?.Invoke(target); + public void RegisterNewTarget(Threat threat) { + _threats.Add(threat); + OnRegisterNewTarget?.Invoke(threat); } } \ No newline at end of file diff --git a/Assets/Scripts/Interceptors/Hydra70.cs b/Assets/Scripts/Interceptors/Hydra70.cs index 55ef014..1d3e0b3 100644 --- a/Assets/Scripts/Interceptors/Hydra70.cs +++ b/Assets/Scripts/Interceptors/Hydra70.cs @@ -48,6 +48,6 @@ public class Hydra70 : Missile { } break; } - SimManager.Instance.AssignMissilesToTargets(submunitions); + SimManager.Instance.AssignMissilesToThreats(submunitions); } } diff --git a/Assets/Scripts/Interceptors/Micromissile.cs b/Assets/Scripts/Interceptors/Micromissile.cs index 92509ae..d094cbc 100644 --- a/Assets/Scripts/Interceptors/Micromissile.cs +++ b/Assets/Scripts/Interceptors/Micromissile.cs @@ -13,19 +13,19 @@ public class Micromissile : Missile { _elapsedTime += deltaTime; Vector3 accelerationInput = Vector3.zero; if (HasAssignedTarget()) { - // Update the target model (assuming we have a target model) - // TODO: Implement target model update logic + // Update the threat model (assuming we have a threat model) + // TODO: Implement threat model update logic - // Correct the state of the target model at the sensor frequency + // Correct the state of the threat model at the sensor frequency float sensorUpdatePeriod = 1f / _agentConfig.dynamic_config.sensor_config.frequency; if (_elapsedTime >= sensorUpdatePeriod) { // TODO: Implement guidance filter to estimate state from sensor output - // For now, we'll use the target's actual state + // For now, we'll use the threat's actual state _sensorOutput = GetComponent().Sense(_target); _elapsedTime = 0; } - // Check whether the target should be considered a miss + // Check whether the threat should be considered a miss SensorOutput sensorOutput = GetComponent().Sense(_target); if (sensorOutput.velocity.range > 1000f) { this.MarkAsMiss(); diff --git a/Assets/Scripts/Missile.cs b/Assets/Scripts/Missile.cs index 2579bfb..7d469fc 100644 --- a/Assets/Scripts/Missile.cs +++ b/Assets/Scripts/Missile.cs @@ -78,7 +78,7 @@ public class Missile : Agent { } // Check if the collision is with another Agent Agent otherAgent = other.gameObject.GetComponentInParent(); - if (otherAgent != null && otherAgent.GetComponent() != null) { + if (otherAgent != null && otherAgent.GetComponent() != null) { // Check kill probability before marking as hit float killProbability = _staticConfig.hitConfig.killProbability; GameObject markerObject = Instantiate(Resources.Load("Prefabs/HitMarkerPrefab"), diff --git a/Assets/Scripts/Monitor.cs b/Assets/Scripts/Monitor.cs index 0ca5cf8..4500103 100644 --- a/Assets/Scripts/Monitor.cs +++ b/Assets/Scripts/Monitor.cs @@ -41,14 +41,14 @@ public class SimMonitor : MonoBehaviour private void ExportTelemetry() { float time = (float)SimManager.Instance.GetElapsedSimulationTime(); - foreach (var agent in SimManager.Instance.GetActiveTargets().Cast().Concat(SimManager.Instance.GetActiveMissiles().Cast())) + foreach (var agent in SimManager.Instance.GetActiveThreats().Cast().Concat(SimManager.Instance.GetActiveMissiles().Cast())) { Vector3 pos = agent.transform.position; if(pos == Vector3.zero) { continue; } Vector3 vel = agent.GetComponent().velocity; - string type = agent is Target ? "T" : "M"; + string type = agent is Threat ? "T" : "M"; writer.WriteLine($"{time:F2},{agent.name},{pos.x:F2},{pos.y:F2},{pos.z:F2},{vel.x:F2},{vel.y:F2},{vel.z:F2},{(int)agent.GetFlightPhase()},{type}"); } diff --git a/Assets/Scripts/SimManager.cs b/Assets/Scripts/SimManager.cs index e8ca321..633b1eb 100644 --- a/Assets/Scripts/SimManager.cs +++ b/Assets/Scripts/SimManager.cs @@ -21,9 +21,9 @@ public class SimManager : MonoBehaviour { private List _missiles = new List(); private List _activeMissiles = new List(); - private List _unassignedTargets = new List(); - private List _targets = new List(); - private List _activeTargets = new List(); + private List _unassignedThreats = new List(); + private List _threats = new List(); + private List _activeThreats = new List(); private float _elapsedSimulationTime = 0f; private float endTime = 100f; // Set an appropriate end time private bool simulationRunning = false; @@ -46,13 +46,13 @@ public class SimManager : MonoBehaviour { return _activeMissiles; } - public List GetActiveTargets() { - return _activeTargets; + public List GetActiveThreats() { + return _activeThreats; } public List GetActiveAgents() { return _activeMissiles.ConvertAll(missile => missile as Agent) - .Concat(_activeTargets.ConvertAll(target => target as Agent)) + .Concat(_activeThreats.ConvertAll(threat => threat as Agent)) .ToList(); } @@ -112,22 +112,25 @@ public class SimManager : MonoBehaviour { } } - List targets = new List(); + List targets = new List(); // Create targets based on config foreach (var swarmConfig in simulationConfig.target_swarm_configs) { for (int i = 0; i < swarmConfig.num_agents; i++) { - var target = CreateTarget(swarmConfig.agent_config); - target.OnAgentHit += RegisterTargetHit; - target.OnAgentMiss += RegisterTargetMiss; + var threat = CreateThreat(swarmConfig.agent_config); + threat.OnAgentHit += RegisterThreatHit; + threat.OnAgentMiss += RegisterThreatMiss; } } _assignmentScheme = new ThreatAssignment(); + + // Invoke the simulation started event to let listeners + // know to invoke their own handler behavior OnSimulationStarted?.Invoke(); } - public void AssignMissilesToTargets() { - AssignMissilesToTargets(_missiles); + public void AssignMissilesToThreats() { + AssignMissilesToThreats(_missiles); } public void RegisterMissileHit(Agent missile) { @@ -142,15 +145,15 @@ public class SimManager : MonoBehaviour { } } - public void RegisterTargetHit(Agent target) { - if (target is Target targetComponent) { - _activeTargets.Remove(targetComponent); + public void RegisterThreatHit(Agent threat) { + if (threat is Threat targetComponent) { + _activeThreats.Remove(targetComponent); } } - public void RegisterTargetMiss(Agent target) { - if (target is Target targetComponent) { - _unassignedTargets.Add(targetComponent); + public void RegisterThreatMiss(Agent threat) { + if (threat is Threat targetComponent) { + _unassignedThreats.Add(targetComponent); } } @@ -158,11 +161,11 @@ public class SimManager : MonoBehaviour { /// Assigns the specified list of missiles to available targets based on the assignment scheme. /// /// The list of missiles to assign. - public void AssignMissilesToTargets(List missilesToAssign) { - // Convert Missile and Target lists to Agent lists + public void AssignMissilesToThreats(List missilesToAssign) { + // Convert Missile and Threat lists to Agent lists List missileAgents = new List(missilesToAssign.ConvertAll(m => m as Agent)); - // Convert Target list to Agent list, excluding already assigned targets - List targetAgents = _unassignedTargets.ToList(); + // Convert Threat list to Agent list, excluding already assigned targets + List targetAgents = _unassignedThreats.ToList(); // Perform the assignment IEnumerable assignments = @@ -172,14 +175,14 @@ public class SimManager : MonoBehaviour { foreach (var assignment in assignments) { if (assignment.MissileIndex < missilesToAssign.Count) { Missile missile = missilesToAssign[assignment.MissileIndex]; - Target target = _unassignedTargets[assignment.TargetIndex]; - missile.AssignTarget(target); - Debug.Log($"Missile {missile.name} assigned to target {target.name}"); + Threat threat = _unassignedThreats[assignment.ThreatIndex]; + missile.AssignTarget(threat); + Debug.Log($"Missile {missile.name} assigned to threat {threat.name}"); } } // TODO this whole function should be optimized - _unassignedTargets.RemoveAll( - target => missilesToAssign.Any(missile => missile.GetAssignedTarget() == target)); + _unassignedThreats.RemoveAll( + threat => missilesToAssign.Any(missile => missile.GetAssignedTarget() == threat)); } /// @@ -209,38 +212,38 @@ public class SimManager : MonoBehaviour { _missiles.Add(missileObject.GetComponent()); _activeMissiles.Add(missileObject.GetComponent()); - // Assign a unique and simple target ID + // Assign a unique and simple ID int missileId = _missiles.Count; missileObject.name = $"{config.missile_type}_Missile_{missileId}"; return missileObject.GetComponent(); } /// - /// Creates a target based on the provided configuration. + /// Creates a threat based on the provided configuration. /// - /// Configuration settings for the target. - /// The created Target instance, or null if creation failed. - private Target CreateTarget(AgentConfig config) { + /// Configuration settings for the threat. + /// The created Threat instance, or null if creation failed. + private Threat CreateThreat(AgentConfig config) { string prefabName = config.target_type switch { - TargetType.DRONE => "DroneTarget", TargetType.MISSILE => "MissileTarget", - _ => throw new System.ArgumentException($"Unsupported target type: {config.target_type}") + ThreatType.DRONE => "DroneTarget", ThreatType.MISSILE => "MissileTarget", + _ => throw new System.ArgumentException($"Unsupported threat type: {config.target_type}") }; - GameObject targetObject = CreateAgent(config, prefabName); - if (targetObject == null) + GameObject threatObject = CreateAgent(config, prefabName); + if (threatObject == null) return null; - _targets.Add(targetObject.GetComponent()); - _activeTargets.Add(targetObject.GetComponent()); - _unassignedTargets.Add(targetObject.GetComponent()); + _threats.Add(threatObject.GetComponent()); + _activeThreats.Add(threatObject.GetComponent()); + _unassignedThreats.Add(threatObject.GetComponent()); - // Assign a unique and simple target ID - int targetId = _targets.Count; - targetObject.name = $"{config.target_type}_Target_{targetId}"; - return targetObject.GetComponent(); + // Assign a unique and simple ID + int targetId = _threats.Count; + threatObject.name = $"{config.target_type}_Target_{targetId}"; + return threatObject.GetComponent(); } /// - /// Creates an agent (missile or target) based on the provided configuration and prefab name. + /// Creates an agent (missile or threat) based on the provided configuration and prefab name. /// /// Configuration settings for the agent. /// Name of the prefab to instantiate. @@ -292,15 +295,15 @@ public class SimManager : MonoBehaviour { } } - foreach (var target in _targets) { - if (target != null) { - Destroy(target.gameObject); + foreach (var threat in _threats) { + if (threat != null) { + Destroy(threat.gameObject); } } _missiles.Clear(); - _targets.Clear(); - _unassignedTargets.Clear(); + _threats.Clear(); + _unassignedThreats.Clear(); StartSimulation(); } diff --git a/Assets/Scripts/Targets/DroneTarget.cs b/Assets/Scripts/Targets/DroneTarget.cs index b8c9e7a..a754fd7 100644 --- a/Assets/Scripts/Targets/DroneTarget.cs +++ b/Assets/Scripts/Targets/DroneTarget.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -public class DroneTarget : Target { +public class DroneTarget : Threat { // Start is called before the first frame update protected override void Start() { base.Start(); diff --git a/Assets/Scripts/Targets/Target.cs b/Assets/Scripts/Targets/Threat.cs similarity index 87% rename from Assets/Scripts/Targets/Target.cs rename to Assets/Scripts/Targets/Threat.cs index f1fca27..2bb3b0b 100644 --- a/Assets/Scripts/Targets/Target.cs +++ b/Assets/Scripts/Targets/Threat.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -public abstract class Target : Agent { +public abstract class Threat : Agent { public override bool IsAssignable() { return false; } diff --git a/Assets/Scripts/Targets/Target.cs.meta b/Assets/Scripts/Targets/Threat.cs.meta similarity index 100% rename from Assets/Scripts/Targets/Target.cs.meta rename to Assets/Scripts/Targets/Threat.cs.meta diff --git a/Assets/Scripts/UI/CameraController.cs b/Assets/Scripts/UI/CameraController.cs index fb16ec2..e851f19 100644 --- a/Assets/Scripts/UI/CameraController.cs +++ b/Assets/Scripts/UI/CameraController.cs @@ -70,7 +70,7 @@ public class CameraController : MonoBehaviour public bool _autoRotate = false; /// - /// Target transform for orbit rotation. + /// Threat transform for orbit rotation. /// public Transform target; diff --git a/Assets/Scripts/UI/Dialogs/AgentStatusDialog.cs b/Assets/Scripts/UI/Dialogs/AgentStatusDialog.cs index 224a330..e011dad 100644 --- a/Assets/Scripts/UI/Dialogs/AgentStatusDialog.cs +++ b/Assets/Scripts/UI/Dialogs/AgentStatusDialog.cs @@ -19,7 +19,7 @@ public class BotStatusDialog : UIDialog submunitions.SetIsSelectable(false); UISelectableEntry targets = CreateSelectableEntry(); - targets.SetTextContent(new List(new string[] { "Targets" })); + targets.SetTextContent(new List(new string[] { "Threats" })); targets.SetIsSelectable(false); SetDialogEntries(new List(new UISelectableEntry[] { missiles, submunitions, targets })); diff --git a/Telemetry/visualize_telemetry.py b/Telemetry/visualize_telemetry.py index 00fb0fd..6788cae 100644 --- a/Telemetry/visualize_telemetry.py +++ b/Telemetry/visualize_telemetry.py @@ -60,7 +60,7 @@ def plot_telemetry(file_path): plt.title('Agents Trajectories (X: Right, Z: Forward, Y: Up)') legend = [ - plt.Line2D([0], [0], color='red', lw=2, label='Target'), + plt.Line2D([0], [0], color='red', lw=2, label='Threat'), plt.Line2D([0], [0], color='blue', lw=2, label='Missile') ] plt.legend(handles=legend) diff --git a/docs/Simulation_Config_Guide.md b/docs/Simulation_Config_Guide.md index cfbc7e6..14b4e34 100644 --- a/docs/Simulation_Config_Guide.md +++ b/docs/Simulation_Config_Guide.md @@ -1,6 +1,6 @@ # Simulation Configuration Guide -This guide provides instructions on how to configure the simulation by editing the configuration files. You can customize missile and target behaviors, simulation parameters, and more to suit your needs. +This guide provides instructions on how to configure the simulation by editing the configuration files. You can customize missile and threat behaviors, simulation parameters, and more to suit your needs. ## Configuration Files @@ -35,7 +35,7 @@ The simulation configurations are defined in JSON files that specify the initial #### `1_salvo_1_hydra_7_drones.json` -This is a basic configuration featuring a single salvo with one missile type (`HYDRA_70`) and seven target drones. +This is a basic configuration featuring a single salvo with one missile type (`HYDRA_70`) and seven threat drones. ```json:Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_drones.json { @@ -78,7 +78,7 @@ This is a basic configuration featuring a single salvo with one missile type (`H "rotation": { "x": 90, "y": 0, "z": 0 }, "velocity": { "x": 0, "y": 0, "z": -50 } }, - // Other target configurations... + // Other threat configurations... } } ] @@ -87,7 +87,7 @@ This is a basic configuration featuring a single salvo with one missile type (`H #### `3_salvo_10_hydra_200_drones.json` -This configuration demonstrates a more complex scenario with three salvos, each launching ten `HYDRA_70` missiles at different times against 200 target drones. This results in a total of 210 missiles (including submunitions) engaging 200 targets. +This configuration demonstrates a more complex scenario with three salvos, each launching ten `HYDRA_70` missiles at different times against 200 threat drones. This results in a total of 210 missiles (including submunitions) engaging 200 targets. ```json:Assets/StreamingAssets/Configs/3_salvo_10_hydra_200_drones.json { @@ -131,7 +131,7 @@ This configuration demonstrates a more complex scenario with three salvos, each "rotation": { "x": 90, "y": 0, "z": 0 }, "velocity": { "x": 0, "y": 0, "z": -50 } }, - // Other target configurations... + // Other threat configurations... } } ] @@ -153,14 +153,14 @@ Multiple salvos are achieved by: - **`timeScale`**: Adjusts the speed of the simulation. - **`missile_swarm_configs`**: Contains settings for missile swarms. Each entry represents a salvo. -- **`target_swarm_configs`**: Contains settings for target swarms. +- **`target_swarm_configs`**: Contains settings for threat swarms. #### Within Each Swarm Configuration - **`num_agents`**: Number of agents (missiles or targets) in the swarm. - **`agent_config`**: Settings for each agent, including: - - **`missile_type`** / **`target_type`**: Defines the type of missile or target. + - **`missile_type`** / **`target_type`**: Defines the type of missile or threat. - **`initial_state`**: Sets the starting position, rotation, and velocity. - **`standard_deviation`**: Adds random noise to initial states for variability. - **`dynamic_config`**: Time-dependent settings like `launch_time` and sensor configurations. @@ -170,7 +170,7 @@ Multiple salvos are achieved by: 1. **Add a New Swarm Configuration**: - To introduce a new missile or target swarm (or an additional salvo), create a new entry in `missile_swarm_configs` or `target_swarm_configs`. + To introduce a new missile or threat swarm (or an additional salvo), create a new entry in `missile_swarm_configs` or `target_swarm_configs`. ```json { @@ -194,7 +194,7 @@ Multiple salvos are achieved by: ## Model Configurations -The model configurations define the physical and performance characteristics of missile and target models. The default models provided can be customized to suit your research needs. +The model configurations define the physical and performance characteristics of missile and threat models. The default models provided can be customized to suit your research needs. ### Available Models @@ -249,7 +249,7 @@ You can tweak the parameters in these model files to adjust performance. For exa ### Adding New Models -To define a new missile or target model: +To define a new missile or threat model: 1. **Create a New JSON File** in `Assets/StreamingAssets/Configs/Models/`. @@ -275,7 +275,7 @@ This script defines the data structures used to interpret the JSON simulation co **Enums**: -- `MissileType`, `TargetType`, and `SensorType` define available types. +- `MissileType`, `ThreatType`, and `SensorType` define available types. ### `StaticConfig.cs`