displayinfo.java
来自「人工智能中Agent开发包。多 Agent 系统是处理自治 Agent 之间知识」· Java 代码 · 共 70 行
JAVA
70 行
/* This software was produced as a part of research activities. It is not intended to be used as commercial or industrial software by any organisation. Except as explicitly stated, no guarantees are given as to its reliability or trustworthiness if used for purposes other than those for which it was originally intended. (c) British Telecommunications plc 1999.*/
/*
This stub file was automatically generated by ZeusAgentGenerator version 1.04
*/
/* Do not edit this class, it has a TaskExternal : DisplayInfoExternal
which it will call when it is executed. Add the code that you want
to be executed when this task is run there instead. */
import java.util.*;
import zeus.util.*;
import zeus.concepts.*;
import zeus.actors.ZeusTask;
import zeus.actors.TaskContext;
public class DisplayInfo extends ZeusTask {
protected void exec() {
// The Input Facts:
Fact[] _var75 = inputArgs[0]; // output
// The Output Facts:
Fact[] _var77; // displayed
System.out.println("-Expected Input-");
for(int i = 0; i < expInputArgs.length; i++ )
System.out.println(expInputArgs[i].pprint());
System.out.println("-Input-");
for(int j = 0; j < inputArgs.length; j++) {
System.out.println("Input Fact["+j+"]");
for(int i = 0; i < inputArgs[j].length; i++)
System.out.println(inputArgs[j][i].pprint());
}
// calling user defined zeus.concepts.TaskExternal
// first set the TaskContext object up
TaskContext taskContext = new TaskContext();
taskContext.setAgentContext (this.context);
taskContext.setInputArgs (inputArgs);
taskContext.setOutputArgs (outputArgs);
// now initialise the external object
DisplayInfoExternal taskExternal = new DisplayInfoExternal();
// now call the TaskExternal implementation specified for this task
taskExternal.exec(taskContext);
System.out.println("-Expected Output-");
for(int i = 0; i < expOutputArgs.length; i++ )
System.out.println(expOutputArgs[i].pprint());
System.out.println("-Output-");
_var77 = new Fact[1];
_var77[0] = new Fact(Fact.FACT,expOutputArgs[0]);
System.out.println(_var77[0].pprint());
outputArgs = new Fact[1][];
outputArgs[0] = _var77;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?