初次提交,只有想定基本结构

This commit is contained in:
2026-02-08 22:26:33 +08:00
parent f810ac44bb
commit fbb0fe1767
32 changed files with 5123 additions and 1 deletions

1
1
View File

@@ -1 +0,0 @@
ceshi

2728
1.log Normal file

File diff suppressed because it is too large Load Diff

0
mission.log Normal file
View File

BIN
output/vPure.aer Normal file

Binary file not shown.

0
output/vPure.evt Normal file
View File

6
output/vPure.log Normal file
View File

@@ -0,0 +1,6 @@
2025-01-31 11:28:27 version wsf 2.9.0
2025-01-31 11:28:27 file C:\Users\27173\Desktop\xd1\xd1_vPure\setup.txt
2025-01-31 11:28:27 AER output file: output/vPure.aer
2025-01-31 11:28:27 Event output file: output/vPure.evt
2025-01-31 11:28:27 start 1
2025-01-31 11:29:07 terminated 2674.579 40.148 31.125

56
platforms/F-16.txt Normal file
View File

@@ -0,0 +1,56 @@
# File generated by Wizard 2.9.0 on Dec 16, 2024.
//! include files
include_once signatures/F-16_sig.txt
platform_type F-16 WSF_PLATFORM
infrared_signature F-16_INFRARED_SIG
optical_signature F-16_OPTICAL_SIG
radar_signature F-16_RADAR_SIG
//! mover
mover WSF_AIR_MOVER
minimum_speed 300 m/s
maximum_speed 1500 m/s
minimum_altitude 500 m
maximum_altitude 500000 km
at_end_of_path stop
end_mover
script_variables
WsfTrack closestTrack = WsfTrack();
end_script_variables
//! fuel
fuel WSF_VARIABLE_RATE_FUEL
initial_quantity 40000 lb
bingo_quantity 1000 lb
maximum_quantity 50000 lb
rate 7 lb/s
end_fuel
//! sensor
sensor radar GENERIC_FIRE_CONTROL_RADAR
on # testing only - the task processor will turn on radar
# off
internal_link data_mgr
internal_link task_mgr
ignore_same_side
end_sensor
//! data_mgr
processor data_mgr WSF_TRACK_PROCESSOR
purge_interval 60 sec
update_interval 1 sec
end_processor
weapon aa_mrm AA_MRM
quantity 8
internal_link task_mgr
internal_link data_mgr
end_weapon
comm cmd_net WSF_COMM_TRANSCEIVER
transfer_rate 100 mbits/sec
network_name <local:slave>
internal_link data_mgr
internal_link intercept_tactics
end_comm
end_platform_type

992
processors/aa_intercept.txt Normal file
View File

@@ -0,0 +1,992 @@
#processor aa_intercept WSF_TASK_PROCESSOR
#
# update_interval 5 sec
#
# script_variables
# double launchRange = 20 * MATH.M_PER_NM();
# double salvoSize = 2;
# string weaponName = "aa_mrm";
# WsfWeapon aa_mrm = PLATFORM.Weapon(weaponName);
# bool canPursue = false;
# Map<string, int> aa_mrmUseful = Map<string, int>();
# WsfTrack currentTarget;
# end_script_variables
#
# //
# //@ pursueCondition
# //
# script bool pursueCondition()
# return (
# aa_mrm.QuantityRemaining() > 0 &&
# TRACK.Target().IsValid()
# );
# end_script
#
# //
# //@ Pursue
# //
# script bool Pursue()
# if (pursueCondition())
# {
# if(PLATFORM.GroundRangeTo(TRACK.CurrentLocation()) >= launchRange)
# {
# PLATFORM.GoToLocation(TRACK.CurrentLocation());
# }
# canPursue = true;
# return canPursue;
# }
# canPursue = false;
# return canPursue;
# end_script
#
# //
# //@ CanEngage
# //
# script bool CanEngage()
# bool canEngage = false;
# if (aa_mrm.IsValid() &&
# aa_mrm.QuantityRemaining() >= salvoSize &&
# TRACK.Target().IsValid() &&
# PLATFORM.GroundRangeTo(TRACK) < launchRange &&
# WeaponsActiveFor(TRACK.TrackId()) < 1
# )
# {
# aa_mrmUseful[weaponName] = 1;
# canEngage = true;
# }
# return canEngage;
# end_script
#
# //
# //@ Engage
# //
# script void Engage()
# if (CanEngage())
# {
# if(aa_mrmUseful.Exists(weaponName))
# {
# if(aa_mrmUseful[weaponName] == 1)
# {
# Fire(TRACK,"FIRE",weaponName,salvoSize,PLATFORM);
# aa_mrmUseful[weaponName] == 0;
# }
# }
# }
# else
# {
# writeln_d("Cannot engage: Conditions not met.");
# }
# end_script
#
# //
# //@ TrackAndEngage
# //
# script void TrackAndEngage()
# if (TRACK.Target().IsValid())
# {
# if (CanEngage())
# {
# Engage();
# }
# else
# {
# Pursue();
# }
# }
# else
# {
# writeln_d("No valid target to track.");
# }
# end_script
#
# //
# //@ WeaponReplenishment
# //
## script void ReplenishWeapons()
## if (aa_mrm.QuantityRemaining() < salvoSize)
## {
## writeln_d("Replenishing weapons: ", weaponName);
## PLATFORM.ReplenishWeapon(weaponName); //
## }
## end_script
#
#/////////////////////state////////////////////////
#evaluation_interval IDLE 1 sec
#
# state IDLE
# on_entry
# writeln_d("Entering IDLE state.");
# end_on_entry
#
# next_state TRACKING
# return TRACK.Target().IsValid();
# end_next_state
#
# on_exit
# writeln_d("Exiting IDLE state.");
# end_on_exit
# end_state
#evaluation_interval TRACKING 1 sec
# state TRACKING
# on_entry
# writeln_d("Entering TRACKING state.");
# end_on_entry
#
# next_state ENGAGING
# return CanEngage();
# end_next_state
#
# next_state PURSUING
# return pursueCondition() && !CanEngage();
# end_next_state
#
# on_exit
# writeln_d("Exiting TRACKING state.");
# end_on_exit
# end_state
#evaluation_interval ENGAGING 1 sec
# state ENGAGING
# on_entry
# writeln_d("Entering ENGAGING state.");
# Engage();
# end_on_entry
#
# next_state IDLE
# return !TRACK.Target().IsValid() || aa_mrm.QuantityRemaining() < salvoSize;
# end_next_state
#
# next_state TRACKING
# return TRACK.Target().IsValid() && !CanEngage();
# end_next_state
#
# on_exit
# writeln_d("Exiting ENGAGING state.");
# end_on_exit
# end_state
#evaluation_interval PURSUING 1 sec
# state PURSUING
# on_entry
# writeln_d("Entering PURSUING state.");
# Pursue();
# end_on_entry
#
# next_state TRACKING
# return TRACK.Target().IsValid() && PLATFORM.GroundRangeTo(TRACK) < launchRange;
# end_next_state
#
# next_state IDLE
# return !pursueCondition();
# end_next_state
#
# on_exit
# writeln_d("Exiting PURSUING state.");
# end_on_exit
# end_state
#
#end_processor
#processor aa_intercept WSF_TASK_PROCESSOR
#
# update_interval 5 sec
#
# script_variables
# double launchRange = 20 * MATH.M_PER_NM(); //
# double salvoSize = 2; //
# string weaponName = "aa_mrm"; //
# WsfWeapon aa_mrm = PLATFORM.Weapon(weaponName); //
# bool canPursue = false; //
# Map<string, int> aa_mrmUseful = Map<string, int>(); //
# WsfTrack currentTarget; //
# end_script_variables
#
# //
# //@ SelectClosestTrack
# //
# script WsfTrack SelectClosestTrack()
# WsfTrack closestTarget;
# double closestDistance = 100000000000000000000000; //
# foreach (WsfTrack track in PLATFORM.MasterTrackList())
# {
# if (track.IsValid() && PLATFORM.GroundRangeTo(track) < closestDistance)
# {
# closestTarget = track;
# closestDistance = PLATFORM.GroundRangeTo(track);
# }
# }
# return closestTarget;
# end_script
#
# //
# //@ pursueCondition
# //
# script bool pursueCondition()
# return (
# aa_mrm.QuantityRemaining() > 0 &&
# currentTarget.IsValid()
# );
# end_script
#
# //
# //@ Pursue
# //
# script bool Pursue()
# if (pursueCondition())
# {
# double distanceToTarget = PLATFORM.GroundRangeTo(currentTarget);
# if (distanceToTarget >= launchRange)
# {
# PLATFORM.GoToLocation(currentTarget.CurrentLocation());
# }
# canPursue = true;
# return canPursue;
# }
# canPursue = false;
# return canPursue;
# end_script
#
# //
# //@ CanEngage
# //
# script bool CanEngage()
# bool canEngage = false;
# if (aa_mrm.IsValid() &&
# aa_mrm.QuantityRemaining() >= salvoSize &&
# currentTarget.IsValid() &&
# PLATFORM.GroundRangeTo(currentTarget) < launchRange &&
# WeaponsActiveFor(currentTarget.TrackId()) < 1
# )
# {
# aa_mrmUseful[weaponName] = 1;
# canEngage = true;
# }
# return canEngage;
# end_script
#
# //
# //@ Engage
# //
# script void Engage()
# if (CanEngage())
# {
# if (aa_mrmUseful.Exists(weaponName))
# {
# if (aa_mrmUseful[weaponName] == 1)
# {
# Fire(currentTarget, "FIRE", weaponName, salvoSize, PLATFORM);
# aa_mrmUseful[weaponName] = 0; //
## EvadeAfterEngage(); //
# }
# }
# }
# else
# {
# writeln_d("Cannot engage: Conditions not met.");
# }
# end_script
#
# //
# //@ EvadeAfterEngage
# //
## script void EvadeAfterEngage()
## writeln_d("Executing evade maneuver after engage.");
## double evadeDistance = launchRange * 0.3; // 30%
## Location evadeLocation = PLATFORM.CurrentLocation().OffsetBy(evadeDistance, MATH.RandomAngle());
## PLATFORM.GoToLocation(RANDOM.loevadeLocation); //
## end_script
#
# //
# //@ TrackAndEngage
# //
# script void TrackAndEngage()
# currentTarget = SelectClosestTrack();
# if (currentTarget.IsValid())
# {
# writeln_d("Selected target ID: ", currentTarget.TrackId());
# if (CanEngage())
# {
# Engage();
# }
# else
# {
# Pursue();
# }
# }
# else
# {
# writeln_d("No valid targets available.");
# }
# end_script
#
#/////////////////////state////////////////////////
#evaluation_interval IDLE 1 sec
#
# state IDLE
# on_entry
# writeln_d("Entering IDLE state.");
# currentTarget = SelectClosestTrack();
# end_on_entry
#
# next_state TRACKING
# return currentTarget.IsValid();
# end_next_state
#
# on_exit
# writeln_d("Exiting IDLE state.");
# end_on_exit
# end_state
#
#evaluation_interval TRACKING 1 sec
#
# state TRACKING
# on_entry
# writeln_d("Entering TRACKING state.");
# currentTarget = SelectClosestTrack();
# end_on_entry
#
# next_state ENGAGING
# return CanEngage();
# end_next_state
#
# next_state PURSUING
# return pursueCondition() && !CanEngage();
# end_next_state
#
# on_exit
# writeln_d("Exiting TRACKING state.");
# end_on_exit
# end_state
#
#evaluation_interval ENGAGING 1 sec
#
# state ENGAGING
# on_entry
# writeln_d("Entering ENGAGING state.");
# Engage();
# end_on_entry
#
# next_state IDLE
# return !currentTarget.IsValid() || aa_mrm.QuantityRemaining() < salvoSize;
# end_next_state
#
# next_state TRACKING
# return currentTarget.IsValid() && !CanEngage();
# end_next_state
#
# on_exit
# writeln_d("Exiting ENGAGING state.");
# end_on_exit
# end_state
#
#evaluation_interval PURSUING 1 sec
#
# state PURSUING
# on_entry
# writeln_d("Entering PURSUING state.");
# Pursue();
# end_on_entry
#
# next_state TRACKING
# return currentTarget.IsValid() && PLATFORM.GroundRangeTo(currentTarget) < launchRange;
# end_next_state
#
# next_state IDLE
# return !pursueCondition();
# end_next_state
#
# on_exit
# writeln_d("Exiting PURSUING state.");
# end_on_exit
# end_state
#
#end_processor
#processor aa_intercept WSF_TASK_PROCESSOR
#
## Update interval
#update_interval 5 sec
#
## Script variables
#script_variables
# double launchRange = 20 * MATH.M_PER_NM(); //
# double salvoSize = 2; //
# string weaponName = "aa_mrm"; //
# WsfWeapon aa_mrm = PLATFORM.Weapon(weaponName); //
# Map<string, int> aa_mrmUseful = Map<string, int>(); //
# WsfTrack currentTarget; //
#end_script_variables
#
## SelectClosestTrack
#script WsfTrack SelectClosestTrack()
# WsfTrack closestTarget;
# double closestDistance = 1000000000; //
# foreach (WsfTrack track in PLATFORM.MasterTrackList())
# {
# if (track.IsValid() && PLATFORM.GroundRangeTo(track) < closestDistance)
# {
# closestTarget = track;
# closestDistance = PLATFORM.GroundRangeTo(track);
# }
# }
# return closestTarget;
#end_script
#
## CanEngage
#script bool CanEngage()
# bool canEngage = false;
# if (aa_mrm.IsValid() &&
# aa_mrm.QuantityRemaining() >= salvoSize &&
# currentTarget.IsValid() &&
# PLATFORM.GroundRangeTo(currentTarget) < launchRange &&
# WeaponsActiveFor(currentTarget.TrackId()) < 1
# )
# {
# aa_mrmUseful[weaponName] = 1;
# canEngage = true;
# }
# return canEngage;
#end_script
#
## Engage
#script void Engage()
# if (CanEngage())
# {
# if (aa_mrmUseful.Exists(weaponName))
# {
# if (aa_mrmUseful[weaponName] == 1)
# {
# Fire(currentTarget, "FIRE", weaponName, salvoSize, PLATFORM);
# aa_mrmUseful[weaponName] = 0; //
# }
# }
# }
# else
# {
# writeln_d("Cannot engage: Conditions not met.");
# }
#end_script
#
## Pursue
#script bool Pursue()
# if (currentTarget.IsValid() && aa_mrm.QuantityRemaining() > 0)
# {
# double distanceToTarget = PLATFORM.GroundRangeTo(currentTarget);
# if (distanceToTarget >= launchRange)
# {
# writeln_d("Target is out of range. Moving closer...");
# PLATFORM.GoToLocation(currentTarget.CurrentLocation());
# return true;
# }
# }
# return false;
#end_script
#
## TrackAndEngage
#script void TrackAndEngage()
# currentTarget = SelectClosestTrack();
# if (currentTarget.IsValid())
# {
# writeln_d("Selected target ID: ", currentTarget.TrackId());
# if (CanEngage())
# {
# Engage();
# }
# else
# {
# Pursue();
# }
# }
# else
# {
# writeln_d("No valid targets available.");
# }
#end_script
#
## States
#
#evaluation_interval IDLE 1 sec
#state IDLE
# on_entry
# writeln_d("Entering IDLE state.");
# currentTarget = SelectClosestTrack();
# end_on_entry
#
# next_state TRACKING
# return currentTarget.IsValid();
# end_next_state
#
# on_exit
# writeln_d("Exiting IDLE state.");
# end_on_exit
#end_state
#
#evaluation_interval TRACKING 1 sec
#state TRACKING
# on_entry
# writeln_d("Entering TRACKING state.");
# currentTarget = SelectClosestTrack();
# end_on_entry
#
# next_state ENGAGING
# return CanEngage();
# end_next_state
#
# next_state PURSUING
# return Pursue() && !CanEngage();
# end_next_state
#
# on_exit
# writeln_d("Exiting TRACKING state.");
# end_on_exit
#end_state
#
#evaluation_interval ENGAGING 1 sec
#state ENGAGING
# on_entry
# writeln_d("Entering ENGAGING state.");
# Engage();
# end_on_entry
#
# next_state IDLE
# return !currentTarget.IsValid() || aa_mrm.QuantityRemaining() < salvoSize;
# end_next_state
#
# next_state TRACKING
# return currentTarget.IsValid() && !CanEngage();
# end_next_state
#
# on_exit
# writeln_d("Exiting ENGAGING state.");
# end_on_exit
#end_state
#
#evaluation_interval PURSUING 1 sec
#state PURSUING
# on_entry
# writeln_d("Entering PURSUING state.");
# end_on_entry
#
# next_state MOVE_TO_TARGET
# return PLATFORM.GroundRangeTo(currentTarget) >= launchRange;
# end_next_state
#
# next_state TRACKING
# return PLATFORM.GroundRangeTo(currentTarget) < launchRange;
# end_next_state
#
# next_state IDLE
# return !currentTarget.IsValid();
# end_next_state
#
# on_exit
# writeln_d("Exiting PURSUING state.");
# end_on_exit
#end_state
#
#evaluation_interval MOVE_TO_TARGET 1 sec
#state MOVE_TO_TARGET
# on_entry
# writeln_d("Entering MOVE_TO_TARGET state.");
# WsfGeoPoint targetLocation = currentTarget.CurrentLocation();
# PLATFORM.GoToLocation(targetLocation);
# end_on_entry
#
# next_state PURSUING
# return PLATFORM.GroundRangeTo(currentTarget) < launchRange;
# end_next_state
#
# next_state IDLE
# return !currentTarget.IsValid();
# end_next_state
#
# on_exit
# writeln_d("Exiting MOVE_TO_TARGET state.");
# end_on_exit
#end_state
#
#end_processor
#processor aa_intercept WSF_TASK_PROCESSOR
#
## Update interval
#update_interval 5 sec
#
## Script variables
#script_variables
# double launchRange = 20 * MATH.M_PER_NM(); //
# double minRange = launchRange * 0.3; // 30%
# double speedFactor = 1.2; // 20%
# string weaponName = "aa_mrm"; //
# WsfWeapon aa_mrm = PLATFORM.Weapon(weaponName); //
# WsfTrack currentTarget; //
#end_script_variables
#
## SelectClosestTrack
#script WsfTrack SelectClosestTrack()
# WsfTrack closestTarget;
# double closestDistance = 1000000000; //
# foreach (WsfTrack track in PLATFORM.MasterTrackList())
# {
# if (track.IsValid() && PLATFORM.GroundRangeTo(track) < closestDistance)
# {
# closestTarget = track;
# closestDistance = PLATFORM.GroundRangeTo(track);
# }
# }
# return closestTarget;
#end_script
#
## AdjustSpeedTowardsTarget
#script void AdjustSpeedTowardsTarget()
# if (currentTarget.IsValid())
# {
# double targetSpeed = currentTarget.Speed();
# double platformSpeed = PLATFORM.Speed();
# double adjustedSpeed = targetSpeed * speedFactor;
#
# if (platformSpeed != adjustedSpeed)
# {
# writeln_d("Adjusting speed to match target...");
# PLATFORM.GoToSpeed(adjustedSpeed); //
# }
# }
#end_script
#
## MaintainOptimalDistance
#script void MaintainOptimalDistance()
# if (currentTarget.IsValid())
# {
# double distanceToTarget = PLATFORM.GroundRangeTo(currentTarget);
# WsfGeoPoint targetLocation = currentTarget.CurrentLocation();
#
# if (distanceToTarget > launchRange) //
# {
# writeln_d("Target out of range, moving closer...");
# PLATFORM.GoToLocation(targetLocation);
# }
# else if (distanceToTarget < minRange) //
# {
# writeln_d("Too close to target, increasing distance...");
## WsfGeoPoint evadeLocation = PLATFORM.Location().OffsetBy(minRange, MATH.OppositeAngle(PLATFORM.BearingTo(targetLocation)));
## PLATFORM.GoToLocation(evadeLocation);
# }
# else
# {
# writeln_d("Optimal distance maintained.");
# }
# }
#end_script
#
## CanEngage
#script bool CanEngage()
# bool canEngage = false;
# if (aa_mrm.IsValid() &&
# aa_mrm.QuantityRemaining() >= 2 &&
# currentTarget.IsValid() &&
# PLATFORM.GroundRangeTo(currentTarget) < launchRange &&
# WeaponsActiveFor(currentTarget.TrackId()) < 1
# )
# {
# canEngage = true;
# }
# return canEngage;
#end_script
#
## Engage
#script void Engage()
# if (CanEngage())
# {
# Fire(currentTarget, "FIRE", weaponName, 2, PLATFORM);
# }
# else
# {
# writeln_d("Cannot engage: Conditions not met.");
# }
#end_script
#
## States
#
#evaluation_interval IDLE 1 sec
#state IDLE
# on_entry
# writeln_d("Entering IDLE state.");
# currentTarget = SelectClosestTrack();
# end_on_entry
#
# next_state TRACKING
# return currentTarget.IsValid();
# end_next_state
#
# on_exit
# writeln_d("Exiting IDLE state.");
# end_on_exit
#end_state
#
#evaluation_interval TRACKING 1 sec
#state TRACKING
# on_entry
# writeln_d("Entering TRACKING state.");
# currentTarget = SelectClosestTrack();
# end_on_entry
#
# next_state ENGAGING
# return CanEngage();
# end_next_state
#
# next_state PURSUING
# return currentTarget.IsValid() && !CanEngage();
# end_next_state
#
# on_exit
# writeln_d("Exiting TRACKING state.");
# end_on_exit
#end_state
#
#evaluation_interval ENGAGING 1 sec
#state ENGAGING
# on_entry
# writeln_d("Entering ENGAGING state.");
# Engage();
# end_on_entry
#
# next_state IDLE
# return !currentTarget.IsValid() || aa_mrm.QuantityRemaining() < 2;
# end_next_state
#
# next_state TRACKING
# return currentTarget.IsValid() && !CanEngage();
# end_next_state
#
# on_exit
# writeln_d("Exiting ENGAGING state.");
# end_on_exit
#end_state
#
#evaluation_interval PURSUING 1 sec
#state PURSUING
# on_entry
# writeln_d("Entering PURSUING state.");
# end_on_entry
#
# next_state ADJUSTING_SPEED
# return currentTarget.IsValid();
# end_next_state
#
# next_state IDLE
# return !currentTarget.IsValid();
# end_next_state
#
# on_exit
# writeln_d("Exiting PURSUING state.");
# end_on_exit
#end_state
#
#evaluation_interval ADJUSTING_SPEED 1 sec
#state ADJUSTING_SPEED
# on_entry
# writeln_d("Entering ADJUSTING_SPEED state.");
# AdjustSpeedTowardsTarget();
# MaintainOptimalDistance();
# end_on_entry
#
# next_state PURSUING
# return true; // PURSUING
# end_next_state
#
# on_exit
# writeln_d("Exiting ADJUSTING_SPEED state.");
# end_on_exit
#end_state
#
#end_processor
processor aa_intercept WSF_TASK_PROCESSOR
# Update interval
update_interval 5 sec
# Script variables
script_variables
double launchRange = 20 * MATH.M_PER_NM(); //
double minRange = launchRange * 0.3; //
double speedFactor = 1.2; // 20%
string weaponName = "aa_mrm"; //
WsfWeapon aa_mrm = PLATFORM.Weapon(weaponName); //
WsfTrack currentTarget; //
end_script_variables
# SelectClosestTrack
script WsfTrack SelectClosestTrack()
WsfTrack closestTarget;
double closestDistance = 1000000000; //
foreach (WsfTrack track in PLATFORM.MasterTrackList())
{
if (track.IsValid() && PLATFORM.GroundRangeTo(track) < closestDistance)
{
closestTarget = track;
closestDistance = PLATFORM.GroundRangeTo(track);
}
}
return closestTarget;
end_script
# PursueLogic
script void PursueLogic()
if (currentTarget.IsValid())
{
double distanceToTarget = PLATFORM.GroundRangeTo(currentTarget);
double targetSpeed = currentTarget.Speed();
double platformSpeed = PLATFORM.Speed();
double adjustedSpeed = targetSpeed * speedFactor;
//
if (platformSpeed != adjustedSpeed)
{
PLATFORM.GoToSpeed(adjustedSpeed);
}
//
if (distanceToTarget > launchRange)
{
PLATFORM.GoToLocation(currentTarget.CurrentLocation());
writeln("Moving closer to target...");
}
}
end_script
# CanEngage
script bool CanEngage()
bool canEngage = false;
if (aa_mrm.IsValid() &&
aa_mrm.QuantityRemaining() >= 1 &&
currentTarget.IsValid() &&
PLATFORM.GroundRangeTo(currentTarget) < launchRange &&
WeaponsActiveFor(currentTarget.TrackId()) < 1
)
{
canEngage = true;
}
return canEngage;
end_script
# Engage
script void Engage()
if (CanEngage())
{
Fire(currentTarget, "FIRE", weaponName, 1, PLATFORM);
}
else
{
writeln("Cannot engage: Conditions not met.");
}
end_script
# States
evaluation_interval IDLE 10 sec
state IDLE
on_entry
writeln("Entering IDLE state.");
currentTarget = SelectClosestTrack();
end_on_entry
next_state TRACKING
return currentTarget.IsValid();
end_next_state
on_exit
writeln("Exiting IDLE state.");
end_on_exit
end_state
evaluation_interval TRACKING 10 sec
time_to_evaluate TRACKING 30 s
state TRACKING
on_entry
writeln("Entering TRACKING state.");
currentTarget = SelectClosestTrack();
end_on_entry
next_state ENGAGING
return CanEngage();
end_next_state
next_state PURSUING
return currentTarget.IsValid() && !CanEngage();
end_next_state
on_exit
writeln("Exiting TRACKING state.");
end_on_exit
end_state
evaluation_interval ENGAGING 10 sec
state ENGAGING
on_entry
writeln("Entering ENGAGING state.");
Engage();
end_on_entry
next_state IDLE
return !currentTarget.IsValid() || aa_mrm.QuantityRemaining() == 0;
end_next_state
next_state TRACKING
return currentTarget.IsValid() && !CanEngage();
end_next_state
on_exit
writeln("Exiting ENGAGING state.");
end_on_exit
end_state
evaluation_interval PURSUING 10 sec
state PURSUING
on_entry
writeln("Entering PURSUING state.");
end_on_entry
next_state ENGAGING
return CanEngage(); //
end_next_state
next_state TRACKING
return !currentTarget.IsValid();
end_next_state
on_exit
writeln("Exiting PURSUING state.");
end_on_exit
end_state
script bool pursueCondition()
return (
aa_mrm.QuantityRemaining() > 0 &&
currentTarget.IsValid()
);
end_script
update_interval 100 sec
on_update
if(pursueCondition())
{
PursueLogic();
}
if(aa_mrm.QuantityRemaining() < 0 &&
!currentTarget.IsValid() )
{
PROCESSOR.TurnOff();
}
end_on_update
end_processor

298
processors/airControl.txt Normal file
View File

@@ -0,0 +1,298 @@
# File generated by Wizard 2.9.0 on Dec 22, 2024.
processor airControl WSF_SCRIPT_PROCESSOR
update_interval 10 sec
script_variables
string zNameOrPoint = "tw";
string zType = "polygon";
WsfTrackList tl = PLATFORM.MasterRawTrackList();
double Radius = 50000;
bool isOver = false;
double LLR = 175000;
double LR = 100000;
double MR = 50000;
double SR = 30000;
double a = 10000000;
bool laststate = false;
bool finish = false;
double startaTime = 0;
double lastTime = 30;
WsfWeapon aa_mrm = PLATFORM.Weapon("aa_mrm"); //
WsfTrack currentTarget; //
end_script_variables
//
//@ flyPolygonalZone
//
script void flyPolygonalZone(string zName)
WsfZone zone = zone.FindZone(zName);
PLATFORM.GoToSpeed(1000,999);
PLATFORM.GoToLocation(zone.Location());
end_script
//
//@ flyCircleZone
//
script void flyCircleZone(string zPoint)
WsfGeoPoint p = p.Construct(zPoint);
PLATFORM.GoToSpeed(1000,999);
PLATFORM.GoToLocation(p);
end_script
//
//@ fly the zone
//
script void flyZone(string zNameOrPoint,string zType)
if(zType == "polygon")
{
flyPolygonalZone(zNameOrPoint);
}
else if(zType == "circle")
{
flyCircleZone(zNameOrPoint);
}
end_script
//
//@ isInZone
//
script bool isInZone(string zNameOrPoint,string zType)
if(zType == "polygon")
{
WsfZone zone = zone.FindZone(zNameOrPoint);
return (PLATFORM.GroundRangeTo(zone.Location())<=100);
}
else if(zType == "circle")
{
WsfGeoPoint p = p.Construct(zNameOrPoint);
return (PLATFORM.GroundRangeTo(p) < 1000);
}
return false;
end_script
// Calculate the distance to the nearest enemy target and return that target's Track
script WsfTrack GetClosestEnemy()
PLATFORM->closestTrack = WsfTrack();
// Initialize an empty WsfTrack object
double minDistance = 9999999.0; // Set an extremely large initial distance
// Iterate through all targets to find the nearest enemy
for (int i = 0; i < PLATFORM.MasterTrackList().Count(); i = i + 1)
{
WsfTrack tempTrack = PLATFORM.MasterTrackList().TrackEntry(i); // Get the target
if (tempTrack.IsValid() && tempTrack.BelievedAlive()) // If the target is valid
{
double distanceToTarget = PLATFORM.GroundRangeTo(tempTrack); // Calculate the ground distance from the current platform to the target
if (distanceToTarget < minDistance) // If this target is closer
{
minDistance = distanceToTarget; // Update the minimum distance
PLATFORM->closestTrack = tempTrack; // Update the nearest target
}
}
}
return PLATFORM->closestTrack; // Return the nearest target
end_script
# script bool isHaveTarget()
# return(PLATFORM.MasterTrackList().Count() > 0);
# end_script
//
//@ bounds Patrol
//
script void airPolygonPatrol(string zNameOrPoint)
WsfZone zone = zone.FindZone(zNameOrPoint);
Array<WsfGeoPoint> boundsPoints = zone.PolyPoints();
WsfRoute route;
WsfRoute r1 = route.Create("lx");
foreach(WsfGeoPoint vertex in boundsPoints)
{
vertex.SetAltitudeHAE(10000);
r1.Append(vertex,1500);
}
r1.Waypoint(0).SetLabel("start");
r1.Waypoint(r1.Size() - 1).SetGoToLabel("start");
PLATFORM.FollowRoute(r1);
isOver =true;
end_script
//
//@ generateCirclePoints
//
script Array<WsfGeoPoint> generateCirclePoints(string Center , double radius)
WsfGeoPoint center= WsfGeoPoint.Construct(Center);
Array<WsfGeoPoint>circlePoints={};
double earthRadius =6371000.0;
double angularDistance =radius /earthRadius;
Array<double>angles ={0.0,120,240};
foreach(double angle in angles)
{
double latCenter=center.Latitude()* MATH.PI()/ 180.0;
double loncenter= center.Longitude()* MATH.PI()/ 180.0;
double lat= MATH.ASin(MATH.Sin(latCenter)
* MATH.Cos(angularDistance)
+ MATH.Cos(latCenter)
* MATH.Sin(angularDistance)
* MATH.Cos(angle));
double lon = loncenter +MATH.ATan2(MATH.Sin(angle)
* MATH.Sin(angularDistance)
* MATH.Cos(latCenter)
, MATH.Cos(angularDistance)
- MATH.Sin(latCenter)
* MATH.Sin(lat));
circlePoints.PushBack(WsfGeoPoint.Construct(lat*180.0/MATH.PI() , lon *180.0 / MATH.PI(),5000));
}
return circlePoints;
end_script
//
//@ circle execute
//
script void executeCircularPatrol(string zNameOrPoint)
Array<WsfGeoPoint> circlePoints = generateCirclePoints(zNameOrPoint,Radius);
WsfRoute route;
WsfRoute r1= route.Create("lx");
foreach(WsfGeoPoint vertex in circlePoints)
{
vertex.SetAltitudeHAE(10000);
r1.Append(vertex,1500);
}
r1.Waypoint(0).SetLabel("start");
r1 .Waypoint(r1.Size()-1).SetGoToLabel("start");
PLATFORM.FollowRoute(r1);
# r1.Print();
isOver =true;
end_script
//
//@ execute patrol
//
script void executePatrol(string zNameOrPoint,string zType)
if(zType == "polygon")
{
airPolygonPatrol(zNameOrPoint);
}
else if(zType == "circle" )
{
executeCircularPatrol(zNameOrPoint);
}
end_script
//
//@ isDecectedTarget
//
script bool isDecectedTarget()
return(PLATFORM.MasterTrackList().Count() > 0 &&
aa_mrm.QuantityRemaining() > 0
# PLATFORM->closestTrack.IsValid()
);
end_script
//
//
//@ finishIntercept
//
script bool finishIntercept()
bool finished = false;
WsfTrack closestTarget = GetClosestEnemy();
if (closestTarget.IsNull() || closestTarget.BelievedDead())
{
writeln("Target is destroyed or not valid.");
finished = true;
}
double currentTime = TIME_NOW;
if (currentTime - startaTime >= lastTime)
{
writeln("Task timeout.");
finished = true;
}
return finished;
end_script
//
//@ ON aa_intercept
//
script void trunOnIntercept()
WsfProcessor launchComputer = PLATFORM.Processor("intercept");
if (! launchComputer.IsTurnedOn())
{
writeln("Starting attack at T=", TIME_NOW);
launchComputer.TurnOn();
}
end_script
//
//@ OFF aa_intercept
//
script void trunOffIntercept()
WsfProcessor launchComputer = PLATFORM.Processor("intercept");
if (! launchComputer.IsTurnedOff())
{
writeln("Stoping attack at T=", TIME_NOW);
launchComputer.TurnOff();
}
end_script
/////////////////////execute//////////////////////////
execute at_time 2 sec relative
writeln("start before PROCESSOR.SetState(MOVER)");
PROCESSOR.SetState("MOVER");
end_execute
/////////////////////state////////////////////////
state MOVER
on_entry
flyZone(zNameOrPoint,zType);
end_on_entry
next_state PATROL
return isInZone(zNameOrPoint,zType);
end_next_state
next_state HIT
return isDecectedTarget();
end_next_state
on_exit
GetClosestEnemy();
end_on_exit
end_state
state PATROL
on_entry
executePatrol(zNameOrPoint,zType);
end_on_entry
next_state HIT
return isDecectedTarget();
end_next_state
on_exit
GetClosestEnemy();
end_on_exit
end_state
state HIT
on_entry
trunOnIntercept();
end_on_entry
next_state PATROL
return (!isDecectedTarget());
end_next_state
on_exit
trunOffIntercept();
end_on_exit
end_state
end_processor

View File

@@ -0,0 +1,18 @@
# File generated by Wizard 2.9.0 on Dec 22, 2024.
processor boundsAreaPatrol WSF_SCRIPT_PROCESSOR
execute at_time 50 sec relative
WsfZone zone = zone.FindZone("tw");
Array<WsfGeoPoint> boundsPoints = zone.PolyPoints();
WsfRoute route;
WsfRoute r1 = route.Create("lx");
foreach(WsfGeoPoint vertex in boundsPoints)
{
vertex.SetAltitudeHAE(10000);
r1.Append(vertex,1500);
}
r1.Waypoint(0).SetLabel("start");
r1.Waypoint(r1.Size() - 1).SetGoToLabel("start");
PLATFORM.FollowRoute(r1);
end_execute
end_processor

43
processors/flyZone.txt Normal file
View File

@@ -0,0 +1,43 @@
# File generated by Wizard 2.9.0 on Dec 22, 2024.
processor flyZone WSF_SCRIPT_PROCESSOR
script_variables
string zNameOrPoint = "tw";
string zType = "polygon";
end_script_variables
//
//@ flyPolygonalZone
//
script void flyPolygonalZone(string zName)
WsfZone zone = zone.FindZone(zName);
PLATFORM.GoToSpeed(1000,999);
PLATFORM.GoToLocation(zone.Location());
end_script
//
//@ flyCircleZone
//
script void flyCircleZone(string zPoint)
WsfGeoPoint p = p.Construct(zPoint);
PLATFORM.GoToSpeed(1000,999);
PLATFORM.GoToLocation(p);
end_script
//
//@ fly the zone
//
script void flyZone(string zNameOrPoint,string zType)
if(zType == "polygon")
{
flyPolygonalZone(zNameOrPoint);
}
else if(zType == "circle")
{
flyCircleZone(zNameOrPoint);
}
end_script
execute at_time 50 sec relative
flyZone(zNameOrPoint,zType);
end_execute
end_processor

80
processors/pathPatrol.txt Normal file
View File

@@ -0,0 +1,80 @@
# File generated by Wizard 2.9.0 on Dec 16, 2024.
processor pathPatrol WSF_TASK_PROCESSOR
script_variables
double launchRange = 20.0 * MATH.M_PER_NM();
double salvoSize = 2;
string weaponName = "aa_mrm";
WsfWeapon aa_mrm = PLATFORM.Weapon(weaponName);
bool canPursue = false;
end_script_variables
script bool pursueCondition()
return (
aa_mrm.QuantityRemaining() > 0 &&
TRACK.Target().IsValid()
);
end_script
script bool Pursue()
if(pursueCondition())
{
PLATFORM.GoToLocation(TRACK.CurrentLocation());
return canPursue;
}
return canPursue;
end_script
script bool runAround()
if(PLATFORM.Side() == "red")
{
PLATFORM.FollowRoute(PLATFORM.Name());
}
return (TRACK.Target().IsValid());
end_script
on_initialize2
PLATFORM.FollowRoute(PLATFORM.Name());
end_on_initialize2
//////////////////////////////////////////STATE MACHINE///////////////////////////////////////
evaluation_interval DETECTED 1 sec
state DETECTED
next_state RUNAROUND
return (!pursueCondition()
|| PLATFORM.MasterTrackList().Count() <= 0
);
end_next_state
next_state PURSUE
return (pursueCondition());
end_next_state
end_state
evaluation_interval PURSUE 1 sec
state PURSUE
next_state WAIT
return Pursue();
end_next_state
end_state
evaluation_interval WAIT 1 sec
state WAIT
next_state DETECTED
return pursueCondition();
end_next_state
next_state RUNAROUND
return (!pursueCondition()
|| PLATFORM.MasterTrackList().Count() <= 0
);
end_next_state
end_state
evaluation_interval RUNAROUND 1 sec
state RUNAROUND
next_state DETECTED
return runAround();
end_next_state
end_state
end_processor

View File

@@ -0,0 +1,62 @@
# File generated by Wizard 2.9.0 on Dec 22, 2024.
processor randomCirclePoint WSF_SCRIPT_PROCESSOR
script_variables
string centerPoint = "";
double Radius = 50000;
bool isOver = false;
end_script_variables
script Array<WsfGeoPoint> generateCirclePoints(string Center , double radius)
WsfGeoPoint center= WsfGeoPoint.Construct(Center);
Array<WsfGeoPoint>circlePoints={};
double earthRadius =6371000.0;
double angularDistance =radius /earthRadius;
Array<double>angles ={0.0,120,240};
foreach(double angle in angles)
{
double latCenter=center.Latitude()* MATH.PI()/ 180.0;
double loncenter= center.Longitude()* MATH.PI()/ 180.0;
double lat= MATH.ASin(MATH.Sin(latCenter)
* MATH.Cos(angularDistance)
+ MATH.Cos(latCenter)
* MATH.Sin(angularDistance)
* MATH.Cos(angle));
double lon = loncenter +MATH.ATan2(MATH.Sin(angle)
* MATH.Sin(angularDistance)
* MATH.Cos(latCenter)
, MATH.Cos(angularDistance)
- MATH.Sin(latCenter)
* MATH.Sin(lat));
circlePoints.PushBack(WsfGeoPoint.Construct(lat*180.0/MATH.PI() , lon *180.0 / MATH.PI(),5000));
}
return circlePoints;
end_script
script void executecircularPatrol()
Array<WsfGeoPoint> circlePoints = generateCirclePoints(centerPoint,Radius);
WsfRoute route;
WsfRoute r1= route.Create("lx");
foreach(WsfGeoPoint vertex in circlePoints)
{
vertex.SetAltitudeHAE(10000);
r1.Append(vertex,1500);
}
r1.Waypoint(0).SetLabel("start");
r1 .Waypoint(r1.Size()-1).SetGoToLabel("start");
PLATFORM.FollowRoute(r1);
# r1.Print();
isOver =true;
end_script
update_interval 1 sec
on_update
if(isOver != true)
{
executecircularPatrol();
}
end_on_update
end_processor

View File

@@ -0,0 +1,61 @@
# File generated by Wizard 2.9.0 on Dec 16, 2024.
zone tw
polygonal lat_lon
maximum_altitude 20 km
point 25:39:39.36n 120:30:25.18e
point 25:06:17.31n 122:29:29.13e
point 21:32:49.50n 121:05:56.86e
point 22:19:43.20n 119:36:49.51e
fill_color red
line_color red
end_zone
processor randomPatrol WSF_SCRIPT_PROCESSOR
script Array<WsfGeoPoint> GenerateRandomPoints(int numPoints)
WsfZone zone = zone.FindZone("tw");
WsfGeoPoint pMax = zone.MaxPoint();
WsfGeoPoint pMin = zone.MinPoint();
Array<WsfGeoPoint> randomPoints = {};
double minLatitude = pMin.Latitude();
double maxLatitude = pMax.Latitude();
double minLongitude = pMin.Longitude();
double maxLongitude = pMax.Longitude();
while(randomPoints.Size() < numPoints)
{
double randomLatitude = RANDOM.Uniform(minLatitude,maxLatitude);
double randomLongitude = RANDOM.Uniform(minLongitude,maxLongitude);
WsfGeoPoint candidatePoint = candidatePoint.Construct(randomLatitude,randomLongitude,5000);
if( zone.PointIsInside(candidatePoint))
{
randomPoints.PushBack(candidatePoint);
}
}
return randomPoints;
end_script
execute at_time 20 sec relative
Array<WsfGeoPoint> randomPoints = GenerateRandomPoints(10);
WsfRoute route;
WsfRoute r1 = route.Create("lx");
# WsfWaypoint wwp1;
# wwp1.SetLabel("start");
# r1.Insert(0,wwp1);
foreach(WsfGeoPoint vertex in randomPoints)
{
r1.Append(vertex,190);
}
# WsfWaypoint wwp2;
# wwp2.SetLabel("start");
# r1.Insert(r1.Size()-1,wwp2);
# r1.Print();
PLATFORM.FollowRoute(r1);
end_execute
end_processor

View File

@@ -0,0 +1,78 @@
# File generated by Wizard 2.9.0 on Dec 22, 2024.
#platform target1 F-16
# //! attribute
# icon F-16
# side blue
# heading 140 deg
# category F-16
#
# // route
# position 21:03:47.40n 118:55:35.40e altitude 5000 m
# route
# position 23:41:55.81n 119:54:27.14e altitude 5000 m speed 10 m/s
# position 18:05:50.14n 120:31:52.57e altitude 5000 m speed 100 m/s
# end_route
#
# //!
#
#end_platform
#
#
#
#platform target11 F-16
# //! attribute
# icon F-16
# side blue
# heading 140 deg
# category F-16
#
# // route
# position 21:03:47.40n 118:55:35.40e altitude 5000 m
# route
# position 25:06:09.06n 119:45:24.35e altitude 5000 m speed 10 m/s
# position 18:05:50.14n 120:31:52.57e altitude 5000 m speed 100 m/s
# end_route
#
# //!
#
#end_platform
#
#
#
#platform target12 F-16
# //! attribute
# icon F-16
# side blue
# heading 140 deg
# category F-16
#
# // route
# position 21:03:47.40n 118:55:35.40e altitude 5000 m
# route
# position 24:53:34.75n 120:52:08.83e altitude 5000 m speed 10 m/s
# position 18:05:50.14n 120:31:52.57e altitude 5000 m speed 100 m/s
# end_route
#
# //!
#
#end_platform
#
#
#
#platform target13 F-16
# //! attribute
# icon F-16
# side blue
# heading 140 deg
# category F-16
#
# // route
# position 21:03:47.40n 118:55:35.40e altitude 5000 m
# route
# position 24:24:28.16n 120:14:42.57e altitude 5000 m speed 10 m/s
# position 18:05:50.14n 120:31:52.57e altitude 5000 m speed 100 m/s
# end_route
#
# //!
#
#end_platform

112
scenarios/red/airDomin.txt Normal file
View File

@@ -0,0 +1,112 @@
# File generated by Wizard 2.9.0 on Dec 16, 2024.
include_once platforms/F-16.txt
include_once processors/scripts/randomPatrol.txt
include_once processors/airControl.txt
include_once sensors/radar/generic_file_control_radar.txt
include_once processors/randomCirclePatrol.txt
include_once processors/pathPatrol.txt
include_once processors/flyZone.txt
include_once processors/boundsAreaPatrol.txt
#platform f16 F-16
#
# //! attribute
# icon F-16
# side red
# heading 140 deg
# category F-16
#
# // route
# position 26:00:19.56n 118:19:53.37e altitude 5000 m
# route
# label start
# position 26:28:16.40n 118:25:17.69e altitude 5000 m speed 1000 m/s
# position 25:19:34.21n 117:24:55.69e altitude 5000 m speed 1000 m/s
# goto start
# end_route
#
# //!
# add processor 112 airControl
# end_processor
# add processor intercept aa_intercept
# end_processor
#end_platform
#
#
#
#
#platform f161 F-16
# //! attribute
# icon F-16
# side red
# heading 140 deg
# category F-16
#
# // route
# position 26:00:19.56n 118:19:53.37e altitude 5000 m
# route
# label start
# position 21:10:19.09n 122:54:47.58e altitude 5000 m speed 1000 m/s
# position 25:19:34.21n 117:24:55.69e altitude 5000 m speed 1000 m/s
# goto start
# end_route
#
# //!
# add processor 112 airControl
# end_processor
# add processor intercept aa_intercept
# end_processor
#end_platform
#
#
#
#
#platform f162 F-16
# //! attribute
# icon F-16
# side red
# heading 140 deg
# category F-16
#
# // route
# position 26:00:19.56n 118:19:53.37e altitude 5000 m
# route
# label start
# position 27:35:47.43n 122:22:10.76e altitude 5000 m speed 1000 m/s
# position 25:19:34.21n 117:24:55.69e altitude 5000 m speed 1000 m/s
# goto start
# end_route
#
# //!
# add processor 112 airControl
# end_processor
# add processor intercept aa_intercept
# end_processor
#end_platform
#
#
#
#
#platform f163 F-16
# //! attribute
# icon F-16
# side red
# heading 140 deg
# category F-16
#
# // route
# position 26:00:19.56n 118:19:53.37e altitude 5000 m
# route
# label start
# position 20:49:06.81n 117:46:23.25e altitude 5000 m speed 1000 m/s
# position 25:19:34.21n 117:24:55.69e altitude 5000 m speed 1000 m/s
# goto start
# end_route
#
# //!
# add processor 112 airControl
# end_processor
# add processor intercept aa_intercept
# end_processor
#end_platform

View File

@@ -0,0 +1,15 @@
# File generated by Wizard 2.9.0 on Dec 22, 2024.
sensor GEO_SENSOR WSF_GEOMETRIC_SENSOR
azimuth_field_of_view -180.0 degrees 180.0 degrees
elevation_field_of_view -20 degrees 89.0 degrees
check_terrain_masking true
minimum_range 6 inch
maximum_range 1000 km
on
frame_time 1 sec
hits_to_establish_track 2 5
hits_to_maintain_track 1 5
reports_location
reports_type
track_quality 0.75
end_sensor

View File

@@ -0,0 +1,21 @@
# File generated by Wizard 2.9.0 on Dec 22, 2024.
sensor LASER_DESIGNATOR-1212 WSF_LASER_DESIGNATOR
azimuth_field_of_view -0.25 deg 0.25 deg
elevation_field_of_view -0.25 deg 0.25 deg
on
maximum_transmission_range 1000 km
terrain_float_distance 10 m
target_association_staleout_interval 10 sec
maximum_target_association_distance 200 m
frame_time 0.1 s
cue_mode both
slew_mode both
laser_code 1212
azimuth_slew_rate 20 deg/s
elevation_slew_rate 20 deg/s
reports_location
transmitter
wavelength 1.06E-6 microns
power 1 mw
end_transmitter
end_sensor

View File

@@ -0,0 +1,82 @@
# ****************************************************************************
# CUI
#
# The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
#
# The use, dissemination or disclosure of data in this file is subject to
# limitation or restriction. See accompanying README and LICENSE for details.
# ****************************************************************************
###################################################################################
#
# UNCLASSIFIED
#
# This is a made up radar
# The antenna came from the RED_MISSILE_SEEKER_1 system from the ship_ad_demo...
###################################################################################
antenna_pattern AA_MRM_RADAR_ANTENNA
sine_pattern
peak_gain 31 db # computed using 420 mm dia & 9 GHz
minimum_gain -10 db # unknown
azimuth_beamwidth 4.6 deg # 420 mm dia & 9 GHz
elevation_beamwidth 4.6 deg # 420 mm dia & 9 GHz
end_sine_pattern
end_antenna_pattern
filter AA_MRM_RADAR_FILTER_TACTICS WSF_KALMAN_FILTER
range_measurement_sigma 4. m
bearing_measurement_sigma 0.2 deg
elevation_measurement_sigma 0.2 deg
# values for maneuvering targets (per Erik)
process_noise_sigmas_XYZ 50 50 30
end_filter
sensor AA_MRM_RADAR WSF_RADAR_SENSOR
#show_calibration_data
maximum_request_count 1
frame_time .50 sec # unknown
one_m2_detect_range 25 km # from aa_mrm.txt documentation
maximum_range 30 km # unknown
slew_mode azimuth_and_elevation # Ref 1
azimuth_slew_limits -30.0 deg 30.0 deg # Ref 1
elevation_slew_limits -20.0 deg 10.0 deg # Ref 1
scan_mode azimuth_and_elevation
azimuth_scan_limits -30.0 deg 30.0 deg
elevation_scan_limits -20.0 deg 10.0 deg
transmitter
antenna_pattern AA_MRM_RADAR_ANTENNA
power 500 w # unknown
frequency 9000 mhz # assuming X-band
pulse_width 1.0 usec # unknown
pulse_repetition_frequency 3600 hz # unknown
end_transmitter
receiver
antenna_pattern AA_MRM_RADAR_ANTENNA
bandwidth 1.0 mhz # use inverse of pulse width
end_receiver
filter AA_MRM_RADAR_FILTER_TACTICS
end_filter
hits_to_establish_track 2 3 # make it easy
hits_to_maintain_track 1 3 # make it real easy
track_quality 1.0 # 'weapons' grade
reports_range
reports_bearing
reports_elevation
end_sensor

View File

@@ -0,0 +1,71 @@
# File generated by Wizard 2.9.0 on Dec 22, 2024.
# ****************************************************************************
# CUI
#
# The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
#
# The use, dissemination or disclosure of data in this file is subject to
# limitation or restriction. See accompanying README and LICENSE for details.
# ****************************************************************************
# made up fire control radar
antenna_pattern GENERIC_FIRE_CONTROL_RADAR_ANTENNA_PATTERN
sine_pattern
azimuth_beamwidth 4.0 deg
elevation_beamwidth 4.0 deg
peak_gain 30 dB
end_sine_pattern
end_antenna_pattern
sensor GENERIC_FIRE_CONTROL_RADAR WSF_RADAR_SENSOR
# off # default
on
no_debug # default
# debug
# slew_mode azimuth_and_elevation
# azimuth_slew_limits -45.0 degrees 45 degrees
# elevation_slew_limits -45.0 degrees 45 degrees
# scan_mode azimuth_and_elevation
# azimuth_scan_limits -15 degrees 15 degrees
# elevation_scan_limits -15 degrees 15 degrees
#
azimuth_slew_limits -180.0 degrees 180 degrees
elevation_slew_limits -90.0 degrees 90 degrees
scan_mode azimuth_and_elevation
azimuth_scan_limits -180 degrees 180 degrees
elevation_scan_limits -90 degrees 90 degrees
minimum_range 2 km
maximum_range 200 km
close_target_detection
end_close_target_detection
# show_calibration_data # display radar characteristics
frame_time 1 sec
transmitter
antenna_pattern GENERIC_FIRE_CONTROL_RADAR_ANTENNA_PATTERN
power 250 kw
frequency 3 ghz
pulse_repetition_frequency 250 hz
pulse_width 8 usec
end_transmitter
receiver
antenna_pattern GENERIC_FIRE_CONTROL_RADAR_ANTENNA_PATTERN
bandwidth 1 mhz
end_receiver
# azimuth_error_sigma 0.3 deg
# elevation_error_sigma 0.3 deg
# range_error_sigma 4 m
#-- Track Formation Commands
reports_bearing
reports_elevation
reports_location
reports_velocity
track_quality 1.0 # Perfect track quality
hits_to_establish_track 2 2 # 2 of last 3 scans to establish track
hits_to_maintain_track 1 2 # 1 of last 2 scans to maintain track
end_sensor

12
setup.txt Normal file
View File

@@ -0,0 +1,12 @@
include_once scenarios/red/airDomin.txt
include_once scenarios/blue/airDomin.txt
include_once weapons/aam/aa_mrm.txt
include_once processors/aa_intercept.txt
define_path_variable CASE vPure
log_file output/$(CASE).log
event_output file output/$(CASE).evt end_event_output
event_pipe file output/$(CASE).aer end_event_pipe
end_time 4 h

19
setup.txt.ide_conf Normal file
View File

@@ -0,0 +1,19 @@
# File generated by AFSIM Wizard
# DO NOT MODIFY, YOUR CHANGES WILL BE OVERWRITTEN
############## Debugger Settings ##############
# The following inputs configure WSF to connect
# to this instance of the AFSIM Wizard.
# This text should be added to your WSF inputs
###############################################
xio_interface
unicast 127.0.0.1 # Change to this hostname if running from another machine
send_port 62253
pause_for_connection yes
debug on
verbose on
end_xio_interface
realtime
minimum_mover_timestep 0 s
# This file contains scripts which enhance the watch variable values
include_once "E:\afsim-2.9.0-win64\resources\data\_wsf_debug_scripts_.txt"

View File

@@ -0,0 +1,6 @@
# File generated by Wizard 2.9.0 on Dec 16, 2024.
# generic F-16 infrared signature
infrared_signature F-16_INFRARED_SIG
constant 10 watts/steradian
end_infrared_signature

View File

@@ -0,0 +1,6 @@
# File generated by Wizard 2.9.0 on Dec 16, 2024.
# generic F-16 optical signature
optical_signature F-16_OPTICAL_SIG
constant 10 m^2
end_optical_signature

View File

@@ -0,0 +1,31 @@
# File generated by Wizard 2.9.0 on Dec 16, 2024.
# generic F-16 radar signature
radar_signature F-16_RADAR_SIG
interpolate_tables $<INTERPOLATE_TABLES:true>$
interpolation_type $<INTERPOLATION_TYPE:linear>$
state default
inline_table dbsm 20 2
-90.0 90.0
-180.0 0.0 0.0
-137.5 0.0 0.0
-135.0 20.0 20.0
-132.5 0.0 0.0
-92.5 0.0 0.0
-90.0 20.0 20.0
-87.5 0.0 0.0
-47.5 0.0 0.0
-45.0 20.0 20.0
-42.5 0.0 0.0
42.5 0.0 0.0
45.0 20.0 20.0
47.5 0.0 0.0
87.5 0.0 0.0
90.0 20.0 20.0
92.5 0.0 0.0
132.5 0.0 0.0
135.0 20.0 20.0
137.5 0.0 0.0
180.0 0.0 0.0
end_inline_table
end_radar_signature

6
signatures/F-16_sig.txt Normal file
View File

@@ -0,0 +1,6 @@
# File generated by Wizard 2.9.0 on Dec 16, 2024.
# generic F-16 signatures
include_once signatures/F-16_infrared_sig.txt
include_once signatures/F-16_optical_sig.txt
include_once signatures/F-16_radar_sig.txt

0
warlock.log Normal file
View File

View File

@@ -0,0 +1,42 @@
# ****************************************************************************
# CUI
#
# The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
#
# The use, dissemination or disclosure of data in this file is subject to
# limitation or restriction. See accompanying README and LICENSE for details.
# ****************************************************************************
# Launch/engagement computer
# If other aa missile types are on the platform, they
# would be added here also
include_once weapons/aam/aa_mrm_launch_computer.txt
script bool AA_LaunchComputer(WsfTrack aTrack, WsfPlatform aAssignee, double aLaunchDelay)
extern bool AA_MRM_LaunchComputer(WsfTrack, WsfPlatform, double);
bool canIntercept = false;
string subType = aAssignee.Type();
if (subType == "JET_AIRCRAFT") # PUT THE CARRYING AIRCRFT TYPE HERE
{
canIntercept = AA_MRM_LaunchComputer(aTrack, aAssignee, aLaunchDelay);
}
return canIntercept;
end_script
# -----------------------------------------------------------------------------
script bool Local_AA_LaunchComputer(WsfTrack aTrack, WsfWeapon aWeapon, double aLaunchDelay)
extern bool AA_MRM_LaunchComputer(WsfTrack, WsfPlatform, double);
bool canIntercept = false;
string weaponType = aWeapon.Type();
WsfPlatform platform = aWeapon.Platform();
if (weaponType == "AA_MRM")
{
canIntercept = AA_MRM_LaunchComputer(aTrack, platform, aLaunchDelay);
}
return canIntercept;
end_script

218
weapons/aam/aa_mrm.txt Normal file
View File

@@ -0,0 +1,218 @@
# ****************************************************************************
# CUI
#
# The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
#
# The use, dissemination or disclosure of data in this file is subject to
# limitation or restriction. See accompanying README and LICENSE for details.
# ****************************************************************************
# UNCLASSIFIED
# This air to air missile boilerplate is an example
# to create air to air missiles.
# For the baseline, it is loosly modeled after the R-77 / AA-12 ADDER
# All sources came from the internet:
# Janes / wikipedia / sinodefence / globalsecurity / fas / deagel etc.
# Even aviation.ru provided spec information.
# The missile is similiar to the AIM-120 AMRAAM and has been
# nicknamed "amraamski". It is a launch and forget type missile
# such that it has its own inertial system and terminal guidance radar.
# From global security:
# Length 3.60 m
# Body diameter 200 mm
# Wingspan 0.35 m
# Launch weight 175 kg
# Warhead 30 kg HE fragmentation
# Fuze Active radar
# Guidance Inertial, command and active radar
# Propulsion Solid propellant
# Range 50 km
# From aviation.ru/missiles.htm:
# launch mass = 175 kg.
# warhead mass = 21 kg.
# max hit range = 50 km.
# min hit range = 300 m.
# max target overload = 12.
# hit probability = 0.7.
# length = 3600 mm.
# body diameter = 200 mm.
# wing span = 750 mm.
# max target speed = 3600 km/h.
# altitude range = 20m..25km.
# max altitude difference = 10 km (can only climb 10 km from launch).
# no carrier overload limitation.
# can be loaded in conform mode or in an internal weapon bay.
# active radar self-guidance head and inertial navigation system with radio correction.
# "fire-and-forget" mode.
# From deagel.com
# Dimensions: Diameter 200 mm, Length 3.6 m, Width 350 mm
# Weights: Max Weight 175 kg (386 lb), Warhead 30 kg (66.1 lb)
# Performance: Ceiling 25,000 m (82,021 ft), Max Range 90,000 m (295,276 ft), Top Speed 1,328 mps (Mach 4)
# Inertial nav / optional inflight midcourse updates / Radar turn on 20km from target
# From enemysources.com
# Range against closing target 150 km
# Range against receding target 50 - 90 km
# Weight 175 kg
# Weight of warhead 30 kg
# Type of warhead expanding rod
# Speed Mach 4+
# Guidance active radarhoming
# Length 3.6 m
# Diameter 0.2 m
# From fas.org
# Length 3.60 m
# Body diameter 200 mm
# Wingspan 0.35 m
# Launch weight 175 kg
# Warhead 30 kg HE fragmentation
# Fuze Active radar
# Guidance Inertial, command and active radar
# Propulsion Solid propellant
# Range 50 km
# From sinodefense
# Length: 3.60m
# Diameter: 0.200m
# Wingspan: 0.350m
# Launch weight: 175kg
# Propellant: Solid fuel rocket motor
# Guidance: Inertial + mid-course command + terminal active radar
# Range: 50~80km
# Warhead: 30kg HE-fragment
# Fuse: Laser proximity fuse
# From Australian Defence Annual Report 2002-3 dated July 4, 2004
# A more recent development is the Vympel R-77 RVV-AE, dubbed the
# "Amraamski" by Western observers94. The Vympel R-77 (AA-12 Adder) is an active
# radar guided BVR AAM and is designed to engage 12 G targets. It employs fuselage
# strakes for enhanced body lift at an AoA in excess of 40<34>, and unique electrically actuated
# "grid" control surfaces to achieve additional control force at high AoA. This is
# claimed to provide a 150<35>/sec turn rate. The R-77 weighs in at 386 lb and Vympel quote
# an A-pole range at altitude of up to 54 NMI, with a minimum range of about 1000 ft. A
# 48.5 lb continuous rod warhead is initiated by a laser proximity fuse.
# This missile, like the US AIM-120, uses digital datalink/inertial midcourse
# guidance and active terminal homing, supports an LOBL off-the-rail active launch mode
# and is claimed to have a Home-On-Jam (HOJ) capability. Carried by the Flanker and Fulcrum,
# the missile requires the APU-170 pylon adaptor, and a late model AI radar such as
# the Phazotron Zhuk or N-011.
# AGAT 9B-1103M/9B-1348E(R-77 Seeker) 25 NMI 1 squared meter detection track range
# AGAT 9B-1103M/9B-1348E(R-77 Seeker) 7 NMI 1 squared meter detection lock range
include sensors/radar/aa_mrm_radar.txt # For now, just put a simple x-band radar on it
aero AA_MRM_AERO WSF_AERO
# Values estimated from Hoerner's Drag book
cd_zero_subsonic 0.30
cd_zero_supersonic 0.50
mach_begin_cd_rise 0.95
mach_end_cd_rise 1.3
mach_max_supersonic 4.0 # Ref
reference_area 0.125 m2 # 200mm body dia
cl_max 3.5
end_aero
platform_type AA_MRM WSF_PLATFORM
icon Missile
mover WSF_GUIDED_MOVER
total_mass 175 kg # all of the sources say this
fuel_mass 80 kg # guess - 30 kg warhead, sensor weight, and body weight
thrust 6500 lbf # to make it go 1300 mps as stated above
thrust_duration 95 sec # sources say several seconds
update_interval 0.05 sec
aero AA_MRM_AERO
end_mover
comm uplink WSF_COMM_TRANSCEIVER
internal_link data_mgr
internal_link task_mgr
end_comm
processor data_mgr WSF_WEAPON_TRACK_PROCESSOR
end_processor
processor task_mgr WSF_TASK_PROCESSOR
end_processor
processor computer WSF_GUIDANCE_COMPUTER
proportional_navigation_gain 455.0
# velocity_pursuit_gain 1.0
g_bias 1.1
maximum_commanded_g 12.0 g
update_interval 0.05 s
end_processor
processor fuse WSF_AIR_TARGET_FUSE
max_time_of_flight_to_detonate 100.0 sec
end_processor
sensor seeker AA_MRM_RADAR
# on # testing only - it gets turned on by the Weapon Track Processor
ignore_same_side
processor data_mgr
internal_link task_mgr
end_sensor
script_variables
bool mTrackFromE2C = false;
bool mTrackFromE2CSet = false;
end_script_variables
processor seeker_turn_on WSF_WEAPON_TRACK_PROCESSOR
# turn_on_sensor seeker 20.0 sec after_launch
turn_on_sensor seeker at_range 20000.0 m before_intercept
update_interval 1 sec
on_update
extern bool mTrackFromE2CSet;
extern bool mTrackFromE2C;
if (! mTrackFromE2CSet)
{
if (PLATFORM.Sensor("seeker").IsTurnedOn())
{
WsfTrack extTrack = PLATFORM.CurrentTargetTrack();
if (extTrack.IsValid() && (extTrack.OriginatorType() == "e2c"))
{
mTrackFromE2C = true;
}
mTrackFromE2CSet = true;
}
}
end_on_update
end_processor
script void on_weapon_target_engagement(WsfWeaponEngagement aEngagement, WsfPlatform aTarget)
writeln_d("*********** on_weapon_target_engagement");
if (mTrackFromE2C)
{
aEngagement.SetPkDegrade(0.6);
}
end_script
end_platform_type
weapon_effects AA_MRM_EFFECT WSF_GRADUATED_LETHALITY # unknown
radius_and_pk 100.0 m 0.7 #radius is unknown pk of .7 documented
end_weapon_effects
weapon AA_MRM WSF_EXPLICIT_WEAPON
aux_data
double LARmeters = 100000
end_aux_data
launched_platform_type AA_MRM
weapon_effects AA_MRM_EFFECT
automatic_target_cueing true
quantity 1
firing_delay 0.2 sec # unknown
salvo_interval 5.0 sec # unknown
firing_interval 15.0 sec # unknown
slew_mode azimuth_and_elevation
azimuth_slew_limits -15.0 deg 15.0 deg # allows for off boresight target slewing
elevation_slew_limits -35.0 deg 15.0 deg # allow some super-elevation for low-alt targets
end_weapon

View File

@@ -0,0 +1,38 @@
# ****************************************************************************
# CUI
#
# The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
#
# The use, dissemination or disclosure of data in this file is subject to
# limitation or restriction. See accompanying README and LICENSE for details.
# ****************************************************************************
# launch computer for the aa_mrm
# Tests the target if it is in the launch envelope of the AA_MRM.
#
script bool AA_MRM_LaunchComputer(WsfTrack aTrack,
WsfPlatform aLauncher,
double aLaunchDelay)
bool canIntercept = false;
#
double tgtAlt = aLauncher.RelativeAltitudeOf(aTrack);
double launcherAlt = aLauncher.Altitude(); # get the launcher altitude
double shootDelay = 0.0;
# simple wpn-spd data for now
double maxRng = 100000; # set the range to 100 km
double maxTOF = 120.0; # set the time of flight to 120 sec
double avgSpd = maxRng / maxTOF; # average speed to 833 meters per second (mach 2.513)
double maxAltDiff = 10000; # Maximum altitude difference to target
WsfWaypoint intercept = WsfWaypoint();
double tti = aLauncher.InterceptLocation2D(aTrack, intercept, avgSpd, aLaunchDelay + shootDelay);
if ((tti > 0.0) && (tti < maxTOF) && (launcherAlt + maxAltDiff > tgtAlt))
{
canIntercept = true;
}
writeln_d("Intercept value = ", canIntercept);
return canIntercept;
end_script

22
wizard-exception.log Normal file
View File

@@ -0,0 +1,22 @@
########################################################################
Mon Dec 16 20:41:20 2024
Version: 2.9.0
Compiler: win_1916_64bit_release-hwe
Wizard threw a fatal exception.
Type: ut::HardwareException
What: Hardware - Write access violation at address 0x0000000000000000.
Stacktrace:
0# 0x7ffa06a27b48 (ut::HardwareException::HardwareException) at ??
1# 0x7ffa06ab2eb6 (ut::SetupThreadErrorHandling) at ??
2# 0x7ffa26eabba5 (_C_specific_handler) at ??
3# 0x7ffa26ea2bf7 (is_exception_typeof) at ??
4# 0x7ffa26ea2b00 (is_exception_typeof) at ??
5# 0x7ffa26ea30df (is_exception_typeof) at ??
6# 0x7ffa26eac15d (_CxxFrameHandler3) at ??
7# 0x7ff9a1465114 (wizard::Util::StripHtml) at ??
8# 0x7ffa2f25527f (_chkstk) at ??
9# 0x7ffa2f1ce886 (RtlFindCharInUnicodeString) at ??
10# 0x7ffa2f25426e (KiUserExceptionDispatcher) at ??

0
wizard.log Normal file
View File