The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Agent - the Transportable Agent Perl module

SYNOPSIS

  use Agent;

  my $a = new Agent( File => 'path_to_agent.pa', @args );

  $a->run();

DESCRIPTION

Agent is meant to be a multi-platform interface for writing and using transportable agents.

A Perl Agent

Is any chunk of Perl code that can accomplish some objective by communicating with other agents, and examining any data it obtains.

A Perl Agent consists of a knowledge base (variables), a reasoning procedure (code), and access to one or more languages coupled with methods of communication. The languages remain largely undefined, or rather, user-defined; support for KQML/KIF is under development.

Developing An Agent

An agent is written as an inheriting sub-class of Agent. Each agent class is stored in a '.pa' file (perl agent), and must contain an agent_main() method. All agents are objects. See the examples for details.

CONSTRUCTOR

new( [%args] )

new creates a new agent object. You can specify what type of agent to create by passing one of these parameters:

    Stored - an Agent stored in a Tom object.
    File - references the file containing the Agent's class code.
    Name - given an agent's name, tells Agent to search for the corresponding '.pa' file and use that.
    Code - the agent's class code.

These are listed in order of precedence. You can also pass a Safe compartment within which the agent will be registered. Any additional arguments will be passed to the agent itself.

METHODS

store ()

store returns the agent object in stringified form, suitable for network transfer.

run ()

run executes the agent. If the Safe argument is passed, run tries to execute the agent in a Safe compartment.

identity ()

identity returns a unique agent identifier in stringified form.

SEE ALSO

Agent::Message and Agent::Transport for developers.

AUTHOR

Steve Purkis <spurkis@engsoc.carleton.ca>

COPYRIGHT

Copyright (c) 1997 Steve Purkis. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

THANKS

James Duncan for the Tom module and many ideas; the Perl5-agents mailing list.