se.liu.ida.critiquer.resources
Interface AgentContributionCalculator<T extends Activity>

All Superinterfaces:
Serializable

public interface AgentContributionCalculator<T extends Activity>
extends Serializable

Interface for functions defined by agents that calculate how long a mission takes to complete. What do we mean by this?

For the missions that agents can participate in, there should be some notion of what capacity they have with respect to handling the mission. This does not, however, have to imply that each agent can solve a mission on their own.

There are only a few cases here as I see it, all under the condition that the agent can actually contribute to an activity:

  1. The agent may be able to do a given part of the job that in turn takes a given amount of time (transporting itself to a rendez-vous point during dispatch).
  2. The agent may do a given amount of work per time unit and, if enough time is given, solve the mission on its own.

Both these contributions can be accomodated using a single method that performs some task and, if appropriate, modifies properties of the activity to reflect the work done. The return value is then the time it took the unit to perform its task. The activity may then calculate how long it will take to complete based on the agents participating by using either the side effects they cause or

"Given" amounts are calculated or specified by the agent. The human planner should specify which agents to use and the job here is only to perform the specified activity.


Method Summary
 long perform(T activity, HashMap<Activity.Properties,Integer> attributes)
          Perform some work by modifying appropriate attributes in the activity to indicate what is being done.
 

Method Detail

perform

long perform(T activity,
             HashMap<Activity.Properties,Integer> attributes)
Perform some work by modifying appropriate attributes in the activity to indicate what is being done. Return the time it took to perform the work. If we consider the case where this operation would mean that we transport people from location A to location B, this would mean that each subsequent call to perform would transport as many people as would fit into the vehicle and drive to location B. The next call would then imply going back to location A, fetch another batch of people there and go back to B.