// ***************************************************************************
// *                      Boeing Proprietary Information
// *                   Copyright @ 2007 The Boeing Company
// *                 Unpublished Work - All Rights Reserved
// *             Third Party Disclosure Requires Written Approval
// ***************************************************************************
// * FILE NAME:
// *   interceptor.txt
// *
// * PURPOSE:
// *   Processor for a RIPR Artificially Intelligent Air
// *      interceptor using the RIPR-AIAI Soar agent.
// *
// * AUTHOR:
// *   Michael Williams
// *
// * NOTES:
// *   None
// ***************************************************************************

include_once ../common/common_platform_script.txt

   processor AIAI-thinker WSF_AIAI_PROCESSOR
      update_interval 0.5 sec

      #script_debug_writes on
      script_debug_writes off
      #script_listing on

      script_variables
           //type of mover
           bool                   mUsePathFinder = false;
           // input weights
           double                 cWEIGHT_CURRENT_TARGET     = 2.0;
           double                 cWEIGHT_CLOSING_SPEED_OF   = 0.25;
           double                 cWEIGHT_SLANT_RANGE_TO     = 1.0;
           double                 cWEIGHT_OTHERS_TARGETING   = -2.0;
           double                 cWEIGHT_WEAPONS_IN_FLIGHT  = 10.0;

           Map<string, double> ThreatTypePriority = Map<string, double>();
          
           # the interceptor uses these threat priority pairs to
           # determine who is the most important threat of concern
           #            category string    threat priority
           ThreatTypePriority["unknown"] = 0.0;
           ThreatTypePriority["uav"]     = 3.0;
           ThreatTypePriority["sam"]     = 4.0;
           ThreatTypePriority["ship"]    = 4.0;
           ThreatTypePriority["awacs"]   = 4.0;
           ThreatTypePriority["bomber"]  = 2.0;
           ThreatTypePriority["jammer"]  = 0.0;
           ThreatTypePriority["fighter"] = 5.0;
           ThreatTypePriority["missile"] = 9.0;

           double                 cMIN_JOB_BID            = -MATH.DOUBLE_MAX();

           double                 cFAST_UPDATE_RATE       = 0.5;
           double                 cSLOW_UPDATE_RATE       = 2.0;
           double                 cTHREAT_TOLERANCE       = 0;
           double                 cTHREAT_GONE            = 0;
           double                 cMAX_DIST               = MATH.DOUBLE_MAX();
           double                 cBUCKET_BASE            = 1.2;
           double                 cWAIT_SPEED             = 200;
           double                 cINTERCEPT_SPEED        = 1000;
           double                 cLAUNCH_TQ              = 0.55;
           double                 cDEFAULT_ALTITUDE       = 10000;
           double                 cCLOSING_SPEED_MIN      = -100;
           double                 cCLOSING_SPEED_MAX      = 1000;
           double                 cEVADE_ALTITUDE_DIFF    = 1000;

           // hacks
           double                 mFPoleAngle             = 45; // this should be radar-specific

           double                 mMaxFiringAngle         = 60.0; // this should be missile-specific
           double                 mLaunchPercentRangeMax  = 0.80; // don't launch until X fraction of Rmax

           double                 mAltitudeMax            = 20000; // meters, hack
           double                 mAltitudeMin            = 1000;

           double                 mLastWeaponFiredTime    = 0.0;
           double                 mLaunchWeaponDelay      = 8.0;
           double                 mLastActiveWeaponTime   = 0.0;
           double                 mInactiveLaunchDelay    = 3.0;  //  Wait 3 seconds after your last missile detonated.
                                                                  //  See what happened with it, did it score a kill?


           #double                 mLastTimeSoarCalled     = 0.0;
           #string                 agentName               = "AIAI-" + PLATFORM.Name();
           #string                 agentProductions        = "RIPR-AIAI.soar";

           Array<Map<string, Object>> mWeaponArray = Array<Map<string, Object>>();
      end_script_variables

   end_processor

