SciLib.AI.Auction
Class BidTree

java.lang.Object
  extended by SciLib.AI.Auction.BidTree

public class BidTree
extends java.lang.Object

This class contains some methods to build a SEARCH2 tree of Tuomas Sandholm.


Field Summary
protected  int depth
           
protected  binNode root
           
 
Constructor Summary
BidTree(int n)
           
 
Method Summary
 int getDepth()
          get depth
 binNode getRoot()
          get root
 double hF()
          get the heuristic function value at the root
 void insert(Bid b)
           
 void insert(Bid b, binNode p)
          insert a node n after the node p in the BidTree
 boolean preprocessing(Bid a)
          perform preprocessing
 void print(binNode n)
          print the subtree for the node n
 void remove(binNode n)
          remove a node from the bidTree
 void remove(java.lang.String s)
           
 java.util.LinkedList<binNode> search(bitStream s)
          search for the nodes that has a specific bitStream pattern
 java.util.LinkedList<binNode> search(java.lang.String s, java.util.LinkedList<binNode> v)
          search for the nodes that has a specific bitStream pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

protected binNode root

depth

protected int depth
Constructor Detail

BidTree

public BidTree(int n)
Method Detail

getRoot

public binNode getRoot()
get root

Returns:
the root of the BidTree, a binNode

getDepth

public int getDepth()
get depth

Returns:
the depth of the BidTree, an integer

insert

public void insert(Bid b,
                   binNode p)
insert a node n after the node p in the BidTree

Parameters:
b - a bid
p - the binNode

insert

public void insert(Bid b)

search

public java.util.LinkedList<binNode> search(java.lang.String s,
                                            java.util.LinkedList<binNode> v)
search for the nodes that has a specific bitStream pattern

Parameters:
s - the bitStream represented as a String, for example "0*11*10**"
v - the of binNode; it is empty before searching
Returns:
a LinkedList of binNode of the same pattern

search

public java.util.LinkedList<binNode> search(bitStream s)
search for the nodes that has a specific bitStream pattern

Parameters:
s - the bitStream represented as a String, for example "0*11*10**"
Returns:
a LinkedList of binNode of the same pattern

print

public void print(binNode n)
print the subtree for the node n

Parameters:
n - the binNode in a BidTree

hF

public double hF()
get the heuristic function value at the root


preprocessing

public boolean preprocessing(Bid a)
perform preprocessing

Returns:
a boolean value

remove

public void remove(binNode n)
remove a node from the bidTree


remove

public void remove(java.lang.String s)