1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package zeus.actors.rtn.util;
25
26 import java.util.*;
27 import zeus.util.*;
28
29 /***
30 * A very specific structure used to manage negotaion between two agents. The
31 * relationship between {@link GraphStruct}, {@link DStruct}, {@link
32 * LocalDStruct} and {@link DelegationStruct} is as follows: Consider that
33 * an agentA is given a goal g0, that decomposes into subgoals g1 and g2 that
34 * need to be achieved externally. <p>
35 * <table>
36 * <tr> <td> {@link GraphStruct} </td> <td> created at the beginning of the
37 * coordination process for goal g0 </td> </tr>
38 * <tr> <td> {@link DStruct} </td> <td> created at the start of contracting/delegation
39 * of subgoals g1 and g2 </td> </tr>
40 * <tr> <td> {@link LocalDStruct} </td> <td> created at the start of
41 * negotiation to achieve each subgoal g1 and g2, will contain additional
42 * information e.g. the negotation protocol/strategy in use </td> </tr>
43 * <tr> <td> {@link DelegationStruct} </td> <td> contains communication
44 * specific information about the contracts </td> <tr>
45 * </table>
46 *
47 * @see GraphStruct, LocalDStruct, DelegationStruct, DStruct
48 */
49 public class LocalDStruct {
50 public Vector goal = null;
51 public String key = null;
52 public String agent = null;
53 public GraphStruct gs = null;
54 public DelegationStruct result = null;
55 public Object any = null;
56
57 public LocalDStruct(String agent, DStruct ds) {
58 this.agent = agent;
59 this.goal = Misc.copyVector(ds.goal);
60 this.gs = ds.gs;
61 }
62
63 public String toString() {
64 String output = "(goal " + goal + "\n " +
65 " key " + key + "\n " +
66 " agent " + agent + "\n " +
67 " gs <gs>\n" +
68 " any " + any + "\n " +
69 " result " + result + "\n " + ")";
70 return output;
71 }
72 }