EMMA Coverage Report (generated Tue May 01 18:46:53 CEST 2007)
[all classes][dk.deepthought.sidious.planner]

COVERAGE SUMMARY FOR SOURCE FILE [GraphFactory.java]

nameclass, %method, %block, %line, %
GraphFactory.java100% (1/1)67%  (2/3)79%  (62/78)77%  (10/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class GraphFactory100% (1/1)67%  (2/3)79%  (62/78)77%  (10/13)
GraphFactory (): void 0%   (0/1)0%   (0/3)0%   (0/1)
makeGraph (SuperLinkID, State, State): Graph 100% (1/1)82%  (58/71)82%  (9/11)
<static initializer> 100% (1/1)100% (4/4)100% (1/1)

1package dk.deepthought.sidious.planner;
2 
3import java.util.Collection;
4 
5import org.apache.commons.logging.Log;
6import org.apache.commons.logging.LogFactory;
7 
8import dk.deepthought.sidious.planner.graph.AStarGraph;
9import dk.deepthought.sidious.planner.graph.Graph;
10import dk.deepthought.sidious.supportsystem.Adjustable;
11import dk.deepthought.sidious.supportsystem.State;
12import dk.deepthought.sidious.supportsystem.SuperLinkID;
13 
14/**
15 * The graph factory.
16 * 
17 * @author Deepthought
18 * 
19 */
20public class GraphFactory {
21 
22        private static final Log logger = LogFactory.getLog(GraphFactory.class);
23 
24        /**
25         * This method is a factory for creating a <code>Graph</code>.
26         * <p>
27         * The input states (<code>source</code> and <code>goal</code>) must:
28         * <li> have same dimension
29         * <li> operate in the same state space
30         * 
31         * @param requester
32         *            the id of the originating <code>PlanRequester</code>
33         * @param source
34         *            the beginning of any path in the graph
35         * @param goal
36         *            the end of any path in the graph
37         * @return a graph
38         */
39        public static Graph makeGraph(SuperLinkID requester, State source,
40                        State goal) {
41                if (logger.isDebugEnabled()) {
42                        logger.debug("makeGraph() - start");
43                }
44                if (requester == null || source == null || goal == null) {
45                        logger.error("makeGraph(SuperLinkID requester=" + requester
46                                        + ", State source=" + source + ", State goal=" + goal
47                                        + ") - not valid input");
48                        throw new IllegalArgumentException("null not valid input");
49                }
50                Collection<Adjustable> adjustables = PlannerEngine
51                                .getAdjustables(requester);
52                Heuristic greenhouseHeuristic = new GreenhouseHeuristic(requester,
53                                source, goal);
54                Graph returnGraph = new AStarGraph(source, goal, adjustables,
55                                greenhouseHeuristic, requester);
56                if (logger.isDebugEnabled()) {
57                        logger.debug("makeGraph() - end - return value=" + returnGraph);
58                }
59                return returnGraph;
60        }
61}

[all classes][dk.deepthought.sidious.planner]
EMMA 2.0.5312 (C) Vladimir Roubtsov