Package edu.brown.graphs.GraphvizExport

Examples of edu.brown.graphs.GraphvizExport.AttributeValues


        if (use_vldb_output || use_full_output) {
            final String empty_set = "\u2205";
           
            if (use_full_output) {
                for (MarkovEdge e : markov.getEdges()) {
                    AttributeValues av = graphviz.getAttributes(e);
                    av.put(Attribute.LABEL, e.toString(true));
                } // FOR
            }
           
            for (MarkovVertex v0 : markov.getVertices()) {
                AttributeValues av = graphviz.getAttributes(v0);
               
                if (highlight_invalid && v0.isValid(markov) == false) {
                    av.put(Attribute.FILLCOLOR, "red");
                    if (debug.val) LOG.warn("Highlighting " + v0 + " as invalid");
                }
               
                String label = "";
           
                // VLDB Figure Output
                if (use_vldb_output) {
                    if (v0.isAbortVertex()) {
                        label = "abort";
                    } else if (v0.isStartVertex()) {
                        label = "begin";
                    } else if (v0.isCommitVertex()) {
                        label = "commit";
                    } else {
                        String name = v0.getCatalogItem().getName();
                        name = StringUtil.title(name.replace("_", " "), true).replace(" ", "");
                       
                        label = name + "\n";
                        label += "Counter: " + v0.getQueryCounter() + "\n";
                       
                        label += "Partitions: ";
                        if (v0.getPartitions().isEmpty()) {
                            label += empty_set;
                        } else {
                            label += "{ ";
                            String add = "";
                            for (Integer p : v0.getPartitions()) {
                                label += add + p;
                                add = ", ";
                            } // FOR
                            label += " }";
                        }
                        label += "\n";
                       
                        label += "Previous: ";
                        if (v0.getPastPartitions().isEmpty()) {
                            label += empty_set;
                        } else {
                            label += "{ ";
                            String add = "";
                            for (Integer p : v0.getPastPartitions()) {
                                label += add + p;
                                add = ", ";
                            } // FOR
                            label += " }";
                        }
                    }
                } else {
                    label = v0.debug();
                }
                av.put(Attribute.LABEL, label);
            } // FOR
        }
       
        return (graphviz);
    }
View Full Code Here

TOP

Related Classes of edu.brown.graphs.GraphvizExport.AttributeValues

Copyright © 2018 www.massapicom. 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.