Hvordan skrive en effektiv kravspesifikasjon

Download Report

Transcript Hvordan skrive en effektiv kravspesifikasjon

MultiAgent Systems
MultiAgent Systems
•
•
•
•
•
•
•
Distributed Artificial Intelligence
MultiAgent Systems
Characteristics of MAS
Challenges of MAS
Networking
Remote Method Invocation
Uniform Resource Location
Distributed Problem Solving
• How a particular problem can be solved by
a number of modules, which cooperate in
dividing and sharing knowledge about the
problem and its evolving solutions.
• All iteraction strategies are incoporated as
an integral part of the system.
Distributed Problem Solving
MultiAgent Systems
• Concerned with the behavior of a collection
of possibly pre-existing autonomous agents
aiming at solving a given problem.
• a loosely coupled network of problem
solvers that work together to solve problems
that are beyond the individual capabilities
or knowledge of each problem solver
MultiAgent Systems
User
Information
Database
Stock Agent
Stock Broker
Analyzer
User
Database
Stock
Market
Seller
Buyer
Mail
Database
Characteristics
• each agent has incomplete information,
or capabilities for solving the problem,
thus each agent has a limited viewpoint
• there is no global system control;
• data is decentralized; and
• computation is asynchronous.
Why MAS?
• the ability to provide robustness and
efficiency;
• the ability to allow inter-operation of
existing legacy systems; and
• the ability to solve problems in which data,
expertise, or control is distributed.
Challenges
• How to formulate, describe, decompose,
and allocate problems and synthesize results
among a group of intelligent agents?
• How to enable agents to communicate and
interact? What communication languages
and protocols to use? What and when to
communicate?
Challenges
• How to ensure that agents act coherently in
making decisions or taking action, accommodating
the non-local effects of local decisions and
avoiding harmful interactions?
• How to enable individual agents to represent and
reason about the actions, plans, and knowledge of
other agents in order to coordinate with them?
How to reason about the state of their coordinated
process (e.g., initiation and completion)?
Challenges
• How to recognize and reconcile disparate
viewpoints and conflicting intentions
among a collection of agents trying to
coordinate their actions?
• How to effectively balance local
computation and communication? More
generally, how to manage allocation of
limited resources?
Challenges
• How to avoid or mitigate harmful overall
system behavior, such as chaotic or
oscillatory behavior?
• How to engineer and constrain practical
MAS systems? How to design technology
platforms and development methodologies
for MAS?
Networking
• Open System Interconnection
• Socket
– IP Address
– Port
• ServerSocket
• RMI
• URL
OSI Model
Application
Application
Presentation
Presentation
Session
Session
Transport
Transport
Network
Network
Network
Network
Data Link
Data Link
Data Link
Data Link
Physical
Physical
Physical
Physical
Socket
• Construction
Socket s = new Socket(hostName, port);
• Read from Socket
BufferedReader r = new BufferedReader(
new InputSreamReader(s.getInputStream());
• Write to Socket
PrintWriter o = new PrintWriter(
s.getOutpuStream(), true);
o.println(”message”);
ServerSocket
Client
Server
Client
ServerSocket
• ServerSocket server = new
ServerSocket(port);
while (true) {
Socket client = server.accept();
< handle the client>
}
Remote Method Invocation
Remote
RMIClient
<<Interface>>
RMIServer
RMIServerImpl
RMI
• Rmiregistry finds registry-name
• Server:
Registry r = LocateRegistry.getRegistry();
r.rebind(Registry_Name, server);
• Client:
Registry reg = LocateRegistry().getRegistry();
server = (RMIServer) reg.lookup(Registry_Name);
URL
• Make a URL
URL s = new URL(”http://...”);
• Read the source
– Get object content: Object o = s.getContent();
– Convert o to InputStream: is = (InputStram)o;
– Read each line from BufferedReader
URL
•
Display a URL
– LinkListener:
Class LinkListener implements HyperlinkListener
{ public void hyperlinkUpdate(HyperlinkEvent e)
{ if (e.getEventType() ==
HyperlinkEvent.EventType.ACTIVATED)
showPage(e.getURL).toString());
}
}
– showPage
JEditorPane content;
void showPage(String location) {
try {
content.setPage(location);
} catch() {}
}