BasicAttractionPoint.java 1.16 KB
Newer Older
1
2
package de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction;

3
import de.tud.kom.p2psim.impl.topology.util.PositionVector;
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.AttractionPoint;

/**
 * A basic attraction point, as simple as it can get. Really just a named location
 * without any checks performed.
 */
public class BasicAttractionPoint extends PositionVector implements AttractionPoint
{
    private String name;
    private double weight = 0;
    private double radius = 0;

    public BasicAttractionPoint(String name, PositionVector pos)
    {
        super(pos);
        this.name = name;
    }


    @Override
    public String getName() {
        return name;
    }

    @Override
    public double getWeight() {
        return weight;
    }

    @Override
    public double getRadius() {
        return radius;
    }

    @Override
    public void setWeight(double weight) {
        this.weight = weight;
    }

    @Override
    public void setRadius(double radius) {
        this.radius = radius;
    }

    @Override
    public AttractionPoint clone(String newName) {
        return new BasicAttractionPoint(newName, this);
    }
}