All Downloads are FREE. Search and download functionalities are using the official Maven repository.

APT.all-test.MOUTBot.execute-mission.sentry-watch.remember-non-visible-contacts.soar Maven / Gradle / Ivy

##################################### 
# file: remember-non-visible-contacts.soar 
# created: REW: 2001-08-26
## 
# Remember contacts (in the sentry-watch reports) that are no longer visible
#
# Change history: 
# 
#  [1] 

echo "\nLoading execute-mission/defend/sentry-watch/remember-non-visible-contacts.soar"
                
# record-contact copies over the id from the input link, so really any negated test would 
# work here because all the information under the id is deleted when the info is removed from the input-link
sp {sentry-watch*propose*remember-non-visible-contacts
   (state  ^name sentry-watch
              ^objective.sentry-watch.contacts )
   ( ^reported-contact )
   ( -^entity.visible true)
   -->
#   (write (crlf) |Proposing: remember-non-visible-contacts|)
   ( ^operator  +, = 50 >)
   ( ^name remember-non-visible-contacts
        ^contact )
}


sp {apply*remember-non-visible-contacts*decrement*visible-count
   (state  ^operator 
              ^objective.sentry-watch.contacts )
   ( ^name remember-non-visible-contacts
              )
   ( ^visible-contacts { > 0  })
   -->
   ( ^visible-contacts  - (-  1) + )
}

# Argggggggggggg!!!!!!!!!!!!
# The input-link treats the area differently for an agent "outside" vs "inside"
# There is no area-name in this case.  For now, I make this specific
# to the outside representation.
sp {apply*remember-non-visible-contacts*remember*reported-contact
   (state  ^operator 
              ^objective.sentry-watch.contacts 
              ^top-state )
   ( ^io.input-link.agent.cycle 
         ^parameters.enemy-remember-time )
   ( ^name remember-non-visible-contacts
         ^contact )
   ( ^reported-contact )
   ( ^entity )
   ( ^range 
            ^area  
            ^aspect 
            ^angle-off 
            ^health 
            ^weapon 
            ^position 

^team ^name ) ( ^v ^h ) (

^x ^y ^z ) ( ^v ^h ) --> ( ^remembered-contact ^reported-contact -) ( ^entity ) ( ^name ^area ^area-name |Outside| ^team ^position ^health ^weapon ^aspect ^angle-off ^visible false ^last-seen-time ) ( ^h ^v ) ( ^x ^y ^z ) ( ^v ^h ) } ### SEARCH CONTROL # If there are contacts that should be deleted, delete them before making a report sp {sentry-watch*compare*remember-non-visible-contacts (state ^name sentry-watch ^operator + +) ( ^name remember-non-visible-contacts) ( ^name report-contacts) --> ( ^operator > ) }