Commit 01e48533 authored by Julian Zobel's avatar Julian Zobel
Browse files

Viz updates and bug fixes

parent e8df1a35
......@@ -20,7 +20,6 @@
package de.tud.kom.p2psim.impl.topology.movement.modularosm;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Composite;
......@@ -68,9 +67,9 @@ public class ModularMovementModelViz extends JComponent
protected boolean showAttractionPoints = true;
protected boolean showNodePositions = true;
protected boolean showNodePositions = false;
protected boolean showTrajectories = true;
protected boolean showTrajectories = false;
protected boolean setupCalculatesTrajectories = false;
......@@ -304,10 +303,11 @@ public class ModularMovementModelViz extends JComponent
protected void drawNodePosition(Graphics2D g2, SimLocationActuator comp)
{
Point2D pt = comp.getRealPosition().asPoint();
g2.setColor(Color.GRAY);
g2.fillOval(VisualizationInjector.scaleValue(pt.getX()) - NODE_SIZE,
VisualizationInjector.scaleValue(pt.getY()) - NODE_SIZE, NODE_SIZE * 2,
NODE_SIZE * 2);
VisualizationInjector.scaleValue(pt.getY()) - NODE_SIZE,
NODE_SIZE * 2, NODE_SIZE * 2);
}
protected void setMovementModel(ModularMovementModel model)
......
......@@ -110,10 +110,12 @@ public class SocialGroupMovementModel extends ModularMovementModel {
// strategy
for (SimLocationActuator ms : moveableHosts) {
attractionAssigment.addComponent(ms);
if(placeNodesAtAP)
ms.updateCurrentLocation(attractionAssigment.getAssignment(ms));
if(placeNodesAtAP) {
AttractionPoint assignment = attractionAssigment.getAssignment(ms);
double apRadius = (assignment.hasRadius() ? Math.max(assignment.getRadius(), 25.0) : 25.0);
ms.updateCurrentLocation(this.addGaussianOffsetToPosition(new PositionVector(assignment), apRadius / 3));
}
}
setTimeBetweenMoveOperations(timeBetweenMoveOperation);
......@@ -125,8 +127,6 @@ public class SocialGroupMovementModel extends ModularMovementModel {
}
}
/**
......
......@@ -29,14 +29,12 @@ import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.Toolkit;
import java.awt.event.AWTEventListener;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.Point2D;
import java.util.Collection;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment