cmsc433.p4
Class MockNodeFactory

java.lang.Object
  extended by cmsc433.p4.MockNodeFactory
All Implemented Interfaces:
NodeFactory<cmsc433.p4.MockNodeFactory.MockNode,cmsc433.p4.MockNodeFactory.Value>

public class MockNodeFactory
extends Object
implements NodeFactory<cmsc433.p4.MockNodeFactory.MockNode,cmsc433.p4.MockNodeFactory.Value>

A mock node factory; do not change this file. Defines a factory that generates 0..numNodes-1 nodes. Each node has up to fanOut*overlap neighbors. A node x has edges to nodes x*fanOut+1 ... x*fanOut + fanOut*(overlap+1) Thus, fanOut = 1, overlap = 0 is a linked list fanOut = 2, overlap = 0 is a binary tree (0 -> {1,2}, 1 -> {3,4}, 2 -> {5,6}, ...). The computation and neighbor calculations require exclusive use of a synthetic processor for the designated time internals. By using synthetic processors, we can simulate a 24 core system on a single processor machine.


Nested Class Summary
static class MockNodeFactory.Builder
           
 
Field Summary
static int DEFAULT_DELAY
          The default delay for both computations and neighbor calculations
static TimeUnit DEFAULT_TIME_UNIT
          The default time unit for both computations and neighbor calculations
 
Method Summary
 int getExpectedParallelism()
          Return the number of cores we want to keep busy.
 Explorer<cmsc433.p4.MockNodeFactory.MockNode,cmsc433.p4.MockNodeFactory.Value> getExplore()
           
 cmsc433.p4.MockNodeFactory.MockNode getStart()
          Return the starting node for the graph.
 boolean match(cmsc433.p4.MockNodeFactory.MockNode n, cmsc433.p4.MockNodeFactory.Value v)
          Return true if value v is a valid result of calling n.compute();
 int numNodesExpected()
          Return the number of nodes reachable from the start vertex.
static void sleep(long time, TimeUnit timeUnit)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DELAY

public static final int DEFAULT_DELAY
The default delay for both computations and neighbor calculations

See Also:
Constant Field Values

DEFAULT_TIME_UNIT

public static final TimeUnit DEFAULT_TIME_UNIT
The default time unit for both computations and neighbor calculations

Method Detail

getExpectedParallelism

public int getExpectedParallelism()
Description copied from interface: NodeFactory
Return the number of cores we want to keep busy.

Specified by:
getExpectedParallelism in interface NodeFactory<cmsc433.p4.MockNodeFactory.MockNode,cmsc433.p4.MockNodeFactory.Value>

getExplore

public Explorer<cmsc433.p4.MockNodeFactory.MockNode,cmsc433.p4.MockNodeFactory.Value> getExplore()

getStart

public cmsc433.p4.MockNodeFactory.MockNode getStart()
Description copied from interface: NodeFactory
Return the starting node for the graph.

Specified by:
getStart in interface NodeFactory<cmsc433.p4.MockNodeFactory.MockNode,cmsc433.p4.MockNodeFactory.Value>

sleep

public static void sleep(long time,
                         TimeUnit timeUnit)

match

public boolean match(cmsc433.p4.MockNodeFactory.MockNode n,
                     cmsc433.p4.MockNodeFactory.Value v)
Description copied from interface: NodeFactory
Return true if value v is a valid result of calling n.compute();

Specified by:
match in interface NodeFactory<cmsc433.p4.MockNodeFactory.MockNode,cmsc433.p4.MockNodeFactory.Value>

numNodesExpected

public int numNodesExpected()
Description copied from interface: NodeFactory
Return the number of nodes reachable from the start vertex.

Specified by:
numNodesExpected in interface NodeFactory<cmsc433.p4.MockNodeFactory.MockNode,cmsc433.p4.MockNodeFactory.Value>