need help for this procedure

From: Neil York Oliver (neilyork82_at_yahoo.com)
Date: 04/29/04

  • Next message: flapper: "Re: lists"
    Date: Thu, 29 Apr 2004 17:20:49 +1000
    
    

    Hi,

    Here is the detailed description in plain text..

    procedure select_action(CurrentLocation, [Goal|Intentions], Action) - which
    takes the agent's current location (a singleton list containing a term
    at(X,Y)) and the list of intentions, and computes an action to be taken by
    the agent. The goal selected by the agent is the first on the list of
    intentions, and in the case of a move action, the action should specify the
    coordinates to which the agent should move (being one square from the agent'
    s current location). Due to the use of Manhattan distance and the fact that
    there are no obstacles in the world, the exact path the agent takes towards
    the goal does not matter much, so choose the simplest way of
    implementing this procedure. //ITEM =GOAL...use goal here

    The case is two-dimensional grid of locations, extending to infinity in both
    directions.Some locations contain "item" (of varying values), which agents
    must "takes"
    in order to score points. An agent takes a piece of item by moving to its
    location and executing antake action. Agents can move one square at a time
    either horizontally or vertically. Item may spontaneously appear at a
    randomly determined location at any time(0.3 probabilty).The initial
    location of the agent is represented by the list [at(0,0)].

    The agent's goals at any time are a list of locations of items and their
    values. Each goal of he agent is represented as an term goal(X,Y,S), where
    (X,Y) is the location of the item and S isits value. The agent's intentions
    are these goals ordered according to some priority. To fulfil an intention,
    the agent's action is just to move along some path towards the corresponding
    item and gain score(S value) (the actual path is determined at run time).
    There are three types of action the agent can execute in any one cycle:
    null - the agent does nothing
    take(X,Y) - the agent takes the item at (X,Y) and gains the score
    move(X,Y) - the agent moves to the location (X,Y)

    The agent then selects an action for execution from the current list of
    intentions (here the agent always selects the first intention on the list if
    there is one, and chooses an appropriate action depending on its current
    position - either taking the item or moving closer to the item).

    The agent's prioritization strategy is very simple: each new goal is
    inserted into the list of intentions in order of the closeness of the item
    to the agent's current position (closer items coming earlier in the list).
    However, once a goal is incorporated into the list of intentions, it is
    never re-prioritized with respect to existing goals as the agent moves about
    (hence after some time the list may not accurately reflect the closeness of
    food to the agent). This strategy thus
    incorporates some "commitment" of the agent to pursuing this goal (the agent
    only changes itsintention to eat a particular item if another food item
    closer to the agent appears). The agent's simple selection strategy of
    choosing the first intention on the list means that the agent choosed to go
    towards the item nearest to the agent when it appeared.

    How could I implement this using lists in prolog?


  • Next message: flapper: "Re: lists"

    Relevant Pages

    • Tileworld Game
      ... descriptionis about Tileworld and only one agent is invloved. ... eats a piece of food by moving to its location and executing an eat action. ... However, once a goal is incorporated into the list of intentions, it ... compute the lists of beliefs and intentions resulting from the agent's ...
      (comp.lang.prolog)
    • Re: lists
      ... The goal selected by the agent is the first on the list of ... intentions, and in the case of a move action, the action should specify the ... The agent's goals at any time are a list of locations of items and their ... to the agent's current position (closer items coming earlier in the list). ...
      (comp.lang.prolog)
    • Re: Replace dangerous side steps
      ... inexpensively when you live in an expensive neighborhood. ... When I read mailing lists, people are always changing the subject line ... even though Agent does sort by thread. ... I've used Netscape a little for news, but not enough to see how it ...
      (alt.home.repair)
    • Re: forming Ticker-Tape in Status Bar after running web Query
      ... I donot know how to write the scrolling TickerTape program ... > You'll have 4 lists. ... >> Now, after i extract data on a worksheet, i want to also refresh the ... >> column in the worksheet which would contain the full list of agent ID's ...
      (microsoft.public.excel.programming)
    • Re: Paging Gene Kearns...
      ... Some people use Agent or Mozilla apps simply to "boycott" Microsoft. ... In a newsgroup, imagine two sorted lists. ... could not sort ALL the watched threads so they'd be at the top of the ... general heap of threads. ...
      (rec.boats)