diff --git a/htroot/Network.html b/htroot/Network.html index 38f148b05..77d7af348 100644 --- a/htroot/Network.html +++ b/htroot/Network.html @@ -249,10 +249,16 @@ To see a list of all APIs, please visit the   - waves + grey waves : crawling activity + +   + green radiation + : + strong query activity +   red lines @@ -260,7 +266,7 @@ To see a list of all APIs, please visit the   +   green lines : DHT-in diff --git a/source/de/anomic/yacy/graphics/NetworkGraph.java b/source/de/anomic/yacy/graphics/NetworkGraph.java index 3a7827314..6515a424e 100644 --- a/source/de/anomic/yacy/graphics/NetworkGraph.java +++ b/source/de/anomic/yacy/graphics/NetworkGraph.java @@ -71,7 +71,7 @@ public class NetworkGraph { private static final String COL_MYPEER_LINE = "FFAAAA"; private static final String COL_MYPEER_TEXT = "FFCCCC"; private static final String COL_DHTOUT = "440000"; - private static final String COL_DHTIN = "004400"; + private static final String COL_DHTIN = "008800"; private static final String COL_BORDER = "000000"; private static final String COL_NORMAL_TEXT = "000000"; @@ -294,20 +294,35 @@ public class NetworkGraph { PrintTool.arcPrint(img, centerX, centerY, innerradius + linelength, angle, name); // draw corona around dot for crawling activity - int ppm20 = seed.getPPM() / 20; - if (coronaangle >= 0 && ppm20 > 0) { - double ca = Math.PI * 2.0 * ((double) coronaangle) / 360.0; - if (ppm20 > 3) ppm20 = 3; - // draw a wave around crawling peers - long strength; - img.setColor("303030"); - img.arcArc(centerX, centerY, innerradius, angle, dotsize + 1, dotsize + 1, 0, 360); - final int waveradius = innerradius / 2; - for (int r = 0; r < waveradius; r++) { - strength = (waveradius - r) * (long) (0x08 * ppm20 * (1.0 + Math.sin(ca + Math.PI * 16 * r / waveradius))) / waveradius; - //System.out.println("r = " + r + ", Strength = " + strength); - img.setColor((strength << 16) | (strength << 8) | strength); - img.arcArc(centerX, centerY, innerradius, angle, dotsize + r, dotsize + r, 0, 360); + int ppmx = seed.getPPM() / 30; + if (coronaangle >= 0 && ppmx > 0) { + drawCorona(img, centerX, centerY, innerradius, angle, dotsize, ppmx, coronaangle, true, false, 24, 24, 24); // color = 0..63 + } + + // draw corona around dot for query activity + int qphx = ((int) (seed.getQPM() * 4.0)); + if (coronaangle >= 0 && qphx > 0) { + drawCorona(img, centerX, centerY, innerradius, angle, dotsize, qphx, coronaangle, false, true, 8, 62, 8); // color = 0..63 + } + } + + private static void drawCorona(final RasterPlotter img, final int centerX, final int centerY, final int innerradius, int angle, int dotsize, int strength, int coronaangle, boolean inside, boolean split, int r, int g, int b) { + double ca = Math.PI * 2.0 * ((double) coronaangle) / 360.0; + if (strength > 4) strength = 4; + // draw a wave around crawling peers + double wave; + final int waveradius = innerradius / 2; + int segments = 72; + for (int radius = 0; radius < waveradius; radius++) { + wave = ((double) (waveradius - radius) * strength) * (1.0 + Math.sin(Math.PI * 16 * radius / waveradius + ((inside) ? ca : -ca))) / 2.0 / (double) waveradius; + img.setColor(((((long) (r * wave)) & 0xff) << 16) | (((long) ((g * wave)) & 0xff) << 8) | ((((long) (b * wave))) & 0xff)); + if (split) { + for (int i = 0; i < segments; i++) { + int a = (coronaangle + 360 * i) / segments; + img.arcArc(centerX, centerY, innerradius, angle, dotsize + radius, dotsize + radius, a, a + 180/segments); + } + } else { + img.arcArc(centerX, centerY, innerradius, angle, dotsize + radius, dotsize + radius, 0, 360); } } } diff --git a/source/net/yacy/cora/document/RSSFeed.java b/source/net/yacy/cora/document/RSSFeed.java index 68756bf86..8f950e7c5 100644 --- a/source/net/yacy/cora/document/RSSFeed.java +++ b/source/net/yacy/cora/document/RSSFeed.java @@ -21,6 +21,7 @@ package net.yacy.cora.document; import java.util.Collections; +import java.util.ConcurrentModificationException; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; @@ -113,7 +114,11 @@ public class RSSFeed implements Iterable { } public RSSMessage next() { - lastGUID = GUIDiterator.next(); + try { + lastGUID = GUIDiterator.next(); + } catch (ConcurrentModificationException e) { + return null; + } if (lastGUID == null) return null; return messages.get(lastGUID); } diff --git a/source/net/yacy/visualization/CircleTool.java b/source/net/yacy/visualization/CircleTool.java index dd2dc7493..f6c03596d 100644 --- a/source/net/yacy/visualization/CircleTool.java +++ b/source/net/yacy/visualization/CircleTool.java @@ -114,9 +114,13 @@ public class CircleTool { } } - public static void circle(final RasterPlotter matrix, final int xc, final int yc, final int radius, final int fromArc, final int toArc) { + public static void circle(final RasterPlotter matrix, final int xc, final int yc, final int radius, int fromArc, int toArc) { // draws only a part of a circle // arc is given in degree + while (fromArc > 360) fromArc -=360; + while (fromArc < 0 ) fromArc +=360; + while ( toArc > 360) toArc -=360; + while ( toArc < 0 ) toArc +=360; if (radius == 0) { matrix.plot(xc, yc, 100); } else { @@ -141,8 +145,22 @@ public class CircleTool { c4x[i + 3 * q] = a2 ; // quadrant 4 c4y[i + 3 * q] = a3 ; // quadrant 4 } - for (int i = q * 4 * fromArc / 360; i < q * 4 * toArc / 360; i++) { + if (fromArc == toArc) { + int i = q * 4 * fromArc / 360; matrix.plot(xc + c4x[i], yc + c4y[i], 100); + } else if (fromArc > toArc) { + // draw two parts + for (int i = q * 4 * fromArc / 360; i < q * 4; i++) { + matrix.plot(xc + c4x[i], yc + c4y[i], 100); + } + for (int i = 0; i < q * 4 * toArc / 360; i++) { + matrix.plot(xc + c4x[i], yc + c4y[i], 100); + } + } else { + // can be drawn in one part + for (int i = q * 4 * fromArc / 360; i < q * 4 * toArc / 360; i++) { + matrix.plot(xc + c4x[i], yc + c4y[i], 100); + } } } }