1.12.0
An action represented by a message. The performative actions are a subset of the FIPA ACL recommendations for interagent communication.
Type: Object
An identifier for an agent or a topic.
(string)
name of the agent
(boolean)
name of topic
(Gateway)
Gateway owner for this AgentID
Sets parameter(s) on the Agent referred to by this AgentID.
(number
= -1
)
index of parameter(s) to be set
(number
= 5000
)
timeout for the response
Promise<(Object | Array<Object>)>
:
a promise which returns the new value(s) of the parameters
Base class for messages transmitted by one agent to another. Creates an empty message.
(Message
= {msgID:null,sender:null}
)
message to which this response corresponds to
(any
= ''
)
(Performative)
performative
A message class that can convey generic messages represented by key-value pairs.
Extends Message
A gateway for connecting to a fjage master container. The new version of the constructor uses an options object instead of individual parameters. The old version with
(Object
= {}
)
Name | Description |
---|---|
opts.hostname string
(default "localhost" )
|
hostname/ip address of the master container to connect to |
opts.port number
(default 1100 )
|
port number of the master container to connect to |
opts.pathname string
(default "" )
|
path of the master container to connect to (for WebSockets) |
opts.keepAlive string
(default true )
|
try to reconnect if the connection is lost |
opts.queueSize number
(default 128 )
|
size of the queue of received messages that haven't been consumed yet |
opts.timeout number
(default 1000 )
|
timeout for fjage level messages in ms |
opts.returnNullOnFailedResponse boolean
(default true )
|
return null instead of throwing an error when a parameter is not found |
(number?)
Deprecated : port number of the master container to connect to
(string
= ="/ws/"
)
Deprecated : path of the master container to connect to (for WebSockets)
(number
= 1000
)
Deprecated : timeout for fjage level messages in ms
(string
= "localhost"
)
Deprecated : hostname/ip address of the master container to connect to
Finds an agent that provides a named service. If multiple agents are registered to provide a given service, any of the agents' id may be returned.
(string)
the named service of interest
Promise<AgentID?>
:
a promise which returns an agent id for an agent that provides the service when resolved
Flush the Gateway queue for all pending messages. This drops all the pending messages.
void
:
Returns a response message received by the gateway. This method returns a {Promise} which resolves when a response is received or if no response is received after the timeout.
(function?)
original message to which a response is expected, or a MessageClass of the type
of message to match, or a closure to use to match against the message
(number
= 0
)
timeout in milliseconds
Promise<Message?>
:
received response message, null on timeout
Closes the gateway. The gateway functionality may not longer be accessed after this method is called.
void
:
Services supported by fjage agents.
Creates a unqualified message class based on a fully qualified name.
(string)
fully qualified name of the message class to be created
(class
= Message
)
class of the parent MessageClass to inherit from
function
:
constructor for the unqualified message class
const ParameterReq = MessageClass('org.arl.fjage.param.ParameterReq');
let pReq = new ParameterReq()