Examples of ToDoubleMapMapping


Examples of ptolemy.graph.mapping.ToDoubleMapMapping

                }
            }

            SingleSourceLongestPathAnalysis longestPath = null;
            longestPath = new SingleSourceLongestPathAnalysis(thisRoundGraph,
                    delayNode, new ToDoubleMapMapping(delayGraphProfitMap));
            D.put(delayNode, longestPath);
        }

        _makeFirstOrderLongestPathMatrix(D, graphPlusDelaysAsNodes,
                predecessorMap);

        // create the delay graph on which the maximum cycle mean is going to
        // be executed.
        DirectedGraph delayGraph = new DirectedGraph();
        HashMap delayGraphEdgeProfits = new HashMap();

        for (int i = 0; i < _delayNodeList.size(); i++) {
            delayGraph.addNode((Node) _delayNodeList.get(i));
        }

        for (int i = 0; i < _delayNodeList.size(); i++) {
            for (int j = 0; j < _delayNodeList.size(); j++) {
                Node source = (Node) _delayNodeList.get(i);
                Node sink = (Node) _delayNodeList.get(j);

                if (_firstOrderLongestPathMatrix[i][j] >= 0) {
                    if (!((source == sink) && (_firstOrderLongestPathMatrix[i][j] == 0))) {
                        Edge addedEdge = delayGraph.addEdge(source, sink);
                        delayGraphEdgeProfits.put(addedEdge, Double
                                .valueOf(_firstOrderLongestPathMatrix[i][j]));
                    }
                }
            }
        }

        double result = _computeMCM(delayGraph, new ToDoubleMapMapping(
                delayGraphEdgeProfits));

        // creating the cycle that leads to the result
        edges = graphPlusDelaysAsNodes.edges().toArray();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.