Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jmadem
Interface UtilityFunctionInt

    public interface UtilityFunctionInt

Interface for the utility functions invoked by MADeMAgArch agents. The code of every utility function must implement this interface.

Author:
  Francisco Grimaldo

Method Summary
`float` | `computeUtility(java.lang.String auctioneer, Allocation alloc, MADeMAgArch agArch)` Computes the normalized utility value given to an allocation.
`java.lang.String` | `getId()` Returns the name of the utility function IMPORTANT NOTE: All utility function names must start in lowercase due to Jason's interpretation of uppercase as variable terms when launching MADeM.

Method Detail

### getId

    java.lang.String getId()

  Returns the name of the utility function

  IMPORTANT NOTE: All utility function names must start in lowercase due to Jason's interpretation of uppercase as variable terms when launching MADeM.

  Returns:
    name of the utility function

### computeUtility

    float computeUtility(java.lang.String auctioneer,
                         Allocation alloc,
                         MADeMAgArch agArch)
                         throws UtilityFunctionException

  Computes the normalized utility value given to an allocation.

  Parameters:
    `auctioneer` - agent asking for preference
    `alloc` - allocation being evaluated
    `agArch` - architecture of the MADeM agent
  Returns:
    the utility value assigned to the allocation. Utility values are between [0, 1]; 0 meaning no preference and 1 meaning the highest preference
  Throws:
    `UtilityFunctionException` - when any error occurs

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD