⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dellpump.~jav

📁 人工智能中Agent开发包。多 Agent 系统是处理自治 Agent 之间知识层的协作问题
💻 ~JAV
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

import zeus.util.*;
import zeus.concepts.*;
import zeus.agents.*;
import zeus.actors.*;

public class DellPump extends JFrame implements ZeusExternal {
   protected AgentContext context = null;

   public DellPump() {
      JButton startBtn = new JButton("Next");
      JPanel contentPane = (JPanel) getContentPane();
      contentPane.setLayout(new BorderLayout());
      contentPane.add(startBtn,BorderLayout.CENTER);
      startBtn.addActionListener(new SymAction());
      setVisible(false);
      this.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
            System.exit(0);
         }
      });
   }

   public void exec(AgentContext context) {
      this.context = context;
      setVisible(true);
      pack();
   }

   protected class SymAction implements ActionListener {
      public void actionPerformed(ActionEvent e) {
         if ( context == null ) return;

         Fact fact = context.OntologyDb().getFact(
            Fact.VARIABLE,"Computer");
         fact.setValue("cpu_speed","400");
         fact.setValue("kb_type","UK");
         fact.setValue("printer_type","laser");
         fact.setValue("monitor_type","svga");
         fact.setNumber(1);
         int now = (int)context.now();
         Goal g = new Goal(context.newId("goal"), fact, now+8, 0,
            context.whoami(), now+7);
         context.Engine().achieve(g);
      }
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -