# ****************************************************************************
# 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.
# ****************************************************************************
# AUTHOR: Michael Williams (michael.x.williams@boeing.com)

### RIPR-AIAI knows how to pick a target and pursue it

sp {evaluate*pursue-target*prefer-lag
   (state <s> ^name RIPR-AIAI
#              ^target-name <name1>
              ^operator <o1> +
              ^operator <o2> +)
   (<o1> ^name pursue-target
         ^actions.pursue-target.pursuit-mode lag
         ^target.target-name <name1>)
   (<o2> ^name pursue-target
         ^actions.pursue-target.pursuit-mode pure
         ^target.target-name <name1>)
-->
   (<s> ^operator <o1> > <o2>)
}

sp {evaluate*pursue-target*prefer-lead
   (state <s> ^name RIPR-AIAI
#              ^target-name <name1>
              ^operator <o1> +
              ^operator <o2> +)
   (<o1> ^name pursue-target
         ^actions.pursue-target.pursuit-mode lead
         ^target.target-name <name1>)
   (<o2> ^name pursue-target
         ^actions.pursue-target.pursuit-mode << pure lag >>
         ^target.target-name <name1>)
-->
   (<s> ^operator <o1> > <o2>)
}

sp {evaluate*pursue-target*prefer-f-pole
   (state <s> ^name RIPR-AIAI
#              ^target-name <name1>
              ^operator <o1> +
              ^operator <o2> +)
   (<o1> ^name pursue-target
         ^actions.pursue-target.pursuit-mode f-pole
         ^target.target-name <name1>)
   (<o2> ^name pursue-target
         ^actions.pursue-target.pursuit-mode << pure lead lag >>
         ^target.target-name <name1>)
-->
   (<s> ^operator <o1> > <o2>)
}


#sp {monitor*pursue-target*counts
#   (state <s> ^name RIPR-AIAI
#              ^operator <o> +)
#   (<o> ^name pursue-target
#        ^target <t>)
#   (<t> ^target-name <name>
#        ^counted <c>)
#   (<c>  ^name <val-name>
#         ^value <v>)
#-->
#   (write (crlf) |count: | <name> | | <val-name> | | <v>  )
#}


#sp {evaluate*proposed-actions-for-diff-targets*indifferent
#   (state <s> ^name check-target
#              ^operator <o1> +
#              ^operator <o2> +)
#   (<o1> ^actions.<command1>.target-name <name1>)
#   (<o2> ^actions.<command2>.target-name {<name2> <> <name1>})
#-->
#   (<s> ^operator <o1> = <o2>)
#}


#sp {evaluate*pursue-target*prefer-high-score
#   (state <s> ^name RIPR-AIAI
#              ^operator <o1> +
#              ^operator { <o2> <> <o1> } +)
#   (<o1> ^name pursue-target
#         ^actions.pursue-target.job-bid <score1>
#         ^target.target-name <name1>)
#   (<o2> ^name pursue-target
#         ^actions.pursue-target.job-bid { <score2> < <score1> }
#         ^target.target-name <name2> <> <name1>)
#-->
#   (<s> ^operator <o1> > <o2>)
#   (write (crlf) |prefer-high-score: | <name1> | (| <score1> |) > | <name2> | (| <score2> |)|)
#}


#sp {evaluate*pursue-target*prefer-fastest-closer
#   (state <s> ^name RIPR-AIAI
#              ^operator <o1> +
#              ^operator <o2> +)
#   (<o1> ^target.closing-speed-of <cso1>)
#   (<o2> ^target.closing-speed-of <cso2> < <cso11>)
#-->
#   (<s> ^operator <o1> > <o2>)
#}
#
#sp {evaluate*pursue-target*prefer-closest
#   (state <s> ^name RIPR-AIAI
#              ^operator <o1> +
#              ^operator <o2> +)
#   (<o1> ^target.slant-range-to <nls1>)
#   (<o2> ^target.slant-range-to <nls2> < <nls1>)
#-->
#   (<s> ^operator <o1> < <o2>)
#}
#
#sp {evaluate*pursue-target*prefer-pure
#   (state <s> ^name RIPR-AIAI
#              ^operator <o1> +
#              ^operator <o2> +)
#   (<o1> ^actions.pursue-target.pursuit-mode pure
#         ^target <t>)
#   (<o2> ^actions.pursue-target.pursuit-mode << lead lag >>
#         ^target <t>)
#-->
#   (<s> ^operator <o1> < <o2>)
#}
#
#sp {evaluate*pursue-target*prefer-lead
#   (state <s> ^name RIPR-AIAI
#              ^operator <o1> +
#              ^operator <o2> +)
#   (<o1> ^actions.pursue-target.pursuit-mode lead
#         ^target <t>)
#   (<o2> ^actions.pursue-target.pursuit-mode lag
#         ^target <t>)
#-->
#   (<s> ^operator <o1> < <o2>)
#}

#sp {evaluate*pursue-target*prefer-current-target
#   (state <s> ^name RIPR-AIAI
#              ^operator <o1> +
#              ^operator <o2> +)
#   (<o1> ^target.currently-targeted 0)
#   (<o2> ^target.currently-targeted 1)
#-->
#   (<s> ^operator <o1> < <o2>)
#}
