public void initialize() { setInitializer(new RandomLocationTransformer<V>(getSize())); maxEpoch = 2000; epoch = 1; radiusConstantTime = 100; radius = 5; minRadius = 1; initialAdaption = 90.0D / 100.0D; adaption = initialAdaption; minAdaption = 0; //factor = 0; //Will be set later on coolingFactor = 2; //temperature = 0.03; //initialJumpRadius = 100; //jumpRadius = initialJumpRadius; //delay = 100; }
/** * Advances the current positions of the graph elements. */ public void step() { status = "epoch: " + epoch + "; "; if (epoch < maxEpoch) { adjust(); updateParameters(); status += " status: running"; } else { status += "adaption: " + adaption + "; "; status += "status: done"; // done = true; } }
private synchronized void adjust() { //Generate random position in graph space Point2D tempXYD = new Point2D.Double(); // creates a new XY data location tempXYD.setLocation(10 + Math.random() * getSize().getWidth(), 10 + Math.random() * getSize().getHeight()); //Get closest vertex to random position V winner = elementAccessor.getVertex(this, tempXYD.getX(), tempXYD.getY()); while(true) { try { for(V v : getGraph().getVertices()) { ISOMVertexData ivd = getISOMVertexData(v); ivd.distance = 0; ivd.visited = false; } break; } catch(ConcurrentModificationException cme) {} } adjustVertex(winner, tempXYD); }
@Override public void actionPerformed(ActionEvent e) { final GraphViewerPanel viewerPanel = (GraphViewerPanel) frame.getTabbedPane().getSelectedComponent(); ISOMLayout isomLayout = new ISOMLayout<String, String>(viewerPanel.getCurrentGraph()); MyVisualizationViewer vv = (MyVisualizationViewer) viewerPanel.getVisualizationViewer(); vv.setGraphLayout(isomLayout); vv.repaint(); } }
private synchronized void adjustVertex(V v, Point2D tempXYD) { queue.clear(); ISOMVertexData ivd = getISOMVertexData(v); ivd.distance = 0; ivd.visited = true; ISOMVertexData currData = getISOMVertexData(current); Point2D currXYData = apply(current); Collection<V> s = getGraph().getNeighbors(current); while(true) { try { for(V child : s) { ISOMVertexData childData = getISOMVertexData(child); if (childData != null && !childData.visited) { childData.visited = true;
private synchronized void adjustVertex(V v, Point2D tempXYD) { queue.clear(); ISOMVertexData ivd = getISOMVertexData(v); ivd.distance = 0; ivd.visited = true; ISOMVertexData currData = getISOMVertexData(current); Point2D currXYData = transform(current); Collection<V> s = getGraph().getNeighbors(current); while(true) { try { for(V child : s) { ISOMVertexData childData = getISOMVertexData(child); if (childData != null && !childData.visited) { childData.visited = true;
/** * Override this method so that the initialize() method cannot set the initializer to * {@link RandomLocationTransformer}. */ @Override public void setInitializer(Transformer<VertexRef,Point2D> ignoreMe) { super.setInitializer(initializer(m_layout)); }
test = new MyPersistentLayoutImpl(new SpringLayout2<String, String>(graph)); } else if (layout.equals("ISOMLayout")) { test = new MyPersistentLayoutImpl(new ISOMLayout<String, String>(graph)); } else if (layout.equals("FRLayout2")) { FRLayout2 frLayout2 = new FRLayout2<String, String>(graph);
/** * Override this method so that the initialize() method cannot set the initializer to * {@link RandomLocationTransformer}. */ @Override public void setInitializer(Transformer<VertexRef,Point2D> ignoreMe) { super.setInitializer(initializer(m_layout)); }
Layout<String,Number> layout = new ISOMLayout<String,Number>(graph);
private synchronized void adjust() { //Generate random position in graph space Point2D tempXYD = new Point2D.Double(); // creates a new XY data location tempXYD.setLocation(10 + Math.random() * getSize().getWidth(), 10 + Math.random() * getSize().getHeight()); //Get closest vertex to random position V winner = elementAccessor.getVertex(this, tempXYD.getX(), tempXYD.getY()); while(true) { try { for(V v : getGraph().getVertices()) { ISOMVertexData ivd = getISOMVertexData(v); ivd.distance = 0; ivd.visited = false; } break; } catch(ConcurrentModificationException cme) {} } adjustVertex(winner, tempXYD); }
public void initialize() { setInitializer(new RandomLocationTransformer<V>(getSize())); maxEpoch = 2000; epoch = 1; radiusConstantTime = 100; radius = 5; minRadius = 1; initialAdaption = 90.0D / 100.0D; adaption = initialAdaption; minAdaption = 0; //factor = 0; //Will be set later on coolingFactor = 2; //temperature = 0.03; //initialJumpRadius = 100; //jumpRadius = initialJumpRadius; //delay = 100; }
/** * Advances the current positions of the graph elements. */ public void step() { status = "epoch: " + epoch + "; "; if (epoch < maxEpoch) { adjust(); updateParameters(); status += " status: running"; } else { status += "adaption: " + adaption + "; "; status += "status: done"; // done = true; } }
private static AbstractLayout<Vertex, Edge> getLayout(GraphJung<Graph> graph, String layoutName) { switch (layoutName) { case "KKLayout": return new KKLayout<>(graph); case "CircleLayout": return new CircleLayout<>(graph); case "FRLayout": return new FRLayout<>(graph); case "FRLayout2": return new FRLayout2<>(graph); case "ISOMLayout": return new ISOMLayout<>(graph); case "SpringLayout": return new SpringLayout<>(graph); default: return new KKLayout<>(graph); } }
Layout<String,Number> layout2 = new ISOMLayout<String,Number>(graph);
final ISOMLayout<FileVertex, Number> graphLayout = new ISOMLayout<>(graph);
switch (graphLayout) { case CIRCLE : layout = new CircleLayout<V, E>(graph); break; case ISOM : layout = new ISOMLayout<V, E>(graph); break; case FR : layout = new FRLayout<V, E>(graph); break; case KK : layout = new KKLayout<V, E>(graph); break;
break; case ISOMLayout: layout = new ISOMLayout<N, EdgeWrapper<E>>(graph); break; case SpringLayout:
break; case ISOMLayout: layout = new ISOMLayout<N, EdgeWrapper<E>>(graph); break; case SpringLayout:
layout = new FRLayout<N, EdgeWrapper<E>>(graph); } else { layout = new ISOMLayout<N, EdgeWrapper<E>>(graph);