View Javadoc

1   /*
2   * The contents of this file are subject to the BT "ZEUS" Open Source 
3   * Licence (L77741), Version 1.0 (the "Licence"); you may not use this file 
4   * except in compliance with the Licence. You may obtain a copy of the Licence
5   * from $ZEUS_INSTALL/licence.html or alternatively from
6   * http://www.labs.bt.com/projects/agents/zeus/licence.htm
7   * 
8   * Except as stated in Clause 7 of the Licence, software distributed under the
9   * Licence is distributed WITHOUT WARRANTY OF ANY KIND, either express or 
10  * implied. See the Licence for the specific language governing rights and 
11  * limitations under the Licence.
12  * 
13  * The Original Code is within the package zeus.*.
14  * The Initial Developer of the Original Code is British Telecommunications
15  * public limited company, whose registered office is at 81 Newgate Street, 
16  * London, EC1A 7AJ, England. Portions created by British Telecommunications 
17  * public limited company are Copyright 1996-9. All Rights Reserved.
18  * 
19  * THIS NOTICE MUST BE INCLUDED ON ANY COPY OF THIS FILE
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  }