diff --git a/Assets/Scripts/Config/ConfigLoader.cs b/Assets/Scripts/Config/ConfigLoader.cs index 71576b1..781c359 100644 --- a/Assets/Scripts/Config/ConfigLoader.cs +++ b/Assets/Scripts/Config/ConfigLoader.cs @@ -66,7 +66,7 @@ public static class ConfigLoader { { Debug.Log(" Agent Configuration:"); Debug.Log($" Interceptor Type: {agentConfig.interceptor_type}"); - Debug.Log($" Threat Type: {agentConfig.target_type}"); + Debug.Log($" Threat Type: {agentConfig.threat_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 d51b499..114cd0a 100644 --- a/Assets/Scripts/Config/SimulationConfig.cs +++ b/Assets/Scripts/Config/SimulationConfig.cs @@ -32,7 +32,7 @@ public class SwarmConfig { [Serializable] public class AgentConfig { public InterceptorType interceptor_type; - public ThreatType target_type; + public ThreatType threat_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 = ThreatType.DRONE, // Or another default value + threat_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 ThreatType target_type; + public ThreatType threat_type; public InitialState initial_state; public PlottingConfig plotting_config; public string prefabName; diff --git a/Assets/Scripts/SimManager.cs b/Assets/Scripts/SimManager.cs index dbe7ff0..70d0b93 100644 --- a/Assets/Scripts/SimManager.cs +++ b/Assets/Scripts/SimManager.cs @@ -224,9 +224,9 @@ public class SimManager : MonoBehaviour { /// 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 { + string prefabName = config.threat_type switch { ThreatType.DRONE => "Drone", ThreatType.ANTISHIP_MISSILE => "AntishipMissile", - _ => throw new System.ArgumentException($"Unsupported threat type: {config.target_type}") + _ => throw new System.ArgumentException($"Unsupported threat type: {config.threat_type}") }; GameObject threatObject = CreateAgent(config, prefabName); if (threatObject == null) @@ -238,7 +238,7 @@ public class SimManager : MonoBehaviour { // Assign a unique and simple ID int targetId = _threats.Count; - threatObject.name = $"{config.target_type}_Target_{targetId}"; + threatObject.name = $"{config.threat_type}_Target_{targetId}"; return threatObject.GetComponent(); } diff --git a/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_drones.json b/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_drones.json index 5d116d6..2577bb5 100644 --- a/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_drones.json +++ b/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_drones.json @@ -5,7 +5,7 @@ "num_agents": 1, "agent_config": { "interceptor_type": "HYDRA_70", - "target_type": "DRONE", + "threat_type": "DRONE", "initial_state": { "position": { "x": 0, "y": 20, "z": 0 }, "rotation": { "x": -45, "y": 0, "z": 0 }, @@ -53,7 +53,7 @@ "num_agents": 7, "agent_config": { "interceptor_type": "HYDRA_70", - "target_type": "DRONE", + "threat_type": "DRONE", "initial_state": { "position": { "x": 0, "y": 600, "z": 6000 }, "rotation": { "x": 90, "y": 0, "z": 0 }, @@ -71,27 +71,7 @@ } }, "submunitions_config": { - "num_submunitions": 0, - "launch_config": { "launch_time": 0 }, - "agent_config": { - "interceptor_type": "HYDRA_70", - "initial_state": { - "position": { "x": 0, "y": 0, "z": 0 }, - "rotation": { "x": 0, "y": 0, "z": 0 }, - "velocity": { "x": 0, "y": 0, "z": 0 } - }, - "standard_deviation": { - "position": { "x": 0, "y": 0, "z": 0 }, - "velocity": { "x": 0, "y": 0, "z": 0 } - }, - "dynamic_config": { - "launch_config": { "launch_time": 0 }, - "sensor_config": { - "type": "IDEAL", - "frequency": 0 - } - } - } + "num_submunitions": 0 } } } diff --git a/Assets/StreamingAssets/Configs/3_salvo_10_hydra_200_drones.json b/Assets/StreamingAssets/Configs/3_salvo_10_hydra_200_drones.json index 5999f4e..8e1adb8 100644 --- a/Assets/StreamingAssets/Configs/3_salvo_10_hydra_200_drones.json +++ b/Assets/StreamingAssets/Configs/3_salvo_10_hydra_200_drones.json @@ -5,7 +5,7 @@ "num_agents": 10, "agent_config": { "interceptor_type": "HYDRA_70", - "target_type": "DRONE", + "threat_type": "DRONE", "initial_state": { "position": { "x": 0, "y": 20, "z": 0 }, "rotation": { "x": -45, "y": 0, "z": 0 }, @@ -51,7 +51,7 @@ "num_agents": 10, "agent_config": { "interceptor_type": "HYDRA_70", - "target_type": "DRONE", + "threat_type": "DRONE", "initial_state": { "position": { "x": 200, "y": 20, "z": 0 }, "rotation": { "x": -60, "y": 0, "z": 0 }, @@ -97,7 +97,7 @@ "num_agents": 10, "agent_config": { "interceptor_type": "HYDRA_70", - "target_type": "DRONE", + "threat_type": "DRONE", "initial_state": { "position": { "x": -100, "y": 20, "z": 0 }, "rotation": { "x": -45, "y": 0, "z": 0 }, @@ -145,7 +145,7 @@ "num_agents": 200, "agent_config": { "interceptor_type": "HYDRA_70", - "target_type": "DRONE", + "threat_type": "DRONE", "initial_state": { "position": { "x": 0, "y": 600, "z": 6000 }, "rotation": { "x": 90, "y": 0, "z": 0 }, @@ -163,27 +163,7 @@ } }, "submunitions_config": { - "num_submunitions": 0, - "launch_config": { "launch_time": 0 }, - "agent_config": { - "interceptor_type": "HYDRA_70", - "initial_state": { - "position": { "x": 0, "y": 0, "z": 0 }, - "rotation": { "x": 0, "y": 0, "z": 0 }, - "velocity": { "x": 0, "y": 0, "z": 0 } - }, - "standard_deviation": { - "position": { "x": 0, "y": 0, "z": 0 }, - "velocity": { "x": 0, "y": 0, "z": 0 } - }, - "dynamic_config": { - "launch_config": { "launch_time": 0 }, - "sensor_config": { - "type": "IDEAL", - "frequency": 0 - } - } - } + "num_submunitions": 0 } } } diff --git a/docs/Simulation_Config_Guide.md b/docs/Simulation_Config_Guide.md index 5675b5d..755477f 100644 --- a/docs/Simulation_Config_Guide.md +++ b/docs/Simulation_Config_Guide.md @@ -72,7 +72,7 @@ This is a basic configuration featuring a single salvo with one interceptor type { "num_agents": 7, "agent_config": { - "target_type": "DRONE", + "threat_type": "DRONE", "initial_state": { "position": { "x": 0, "y": 600, "z": 6000 }, "rotation": { "x": 90, "y": 0, "z": 0 }, @@ -125,7 +125,7 @@ This configuration demonstrates a more complex scenario with three salvos, each { "num_agents": 200, "agent_config": { - "target_type": "DRONE", + "threat_type": "DRONE", "initial_state": { "position": { "x": 0, "y": 600, "z": 6000 }, "rotation": { "x": 90, "y": 0, "z": 0 }, @@ -160,7 +160,7 @@ Multiple salvos are achieved by: - **`num_agents`**: Number of agents (missiles or targets) in the swarm. - **`agent_config`**: Settings for each agent, including: - - **`interceptor_type`** / **`target_type`**: Defines the type of interceptor or threat. + - **`interceptor_type`** / **`threat_type`**: Defines the type of interceptor 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.