Skip to content

Commit

Permalink
moar fretting
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellblazer committed Aug 27, 2023
1 parent 12e9f7a commit bf30eaa
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 155 deletions.
29 changes: 11 additions & 18 deletions sentinel/src/main/java/com/hellblazer/luciferase/sentinel/SOI.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import javax.vecmath.Tuple3f;

import com.hellblazer.luciferase.thoth.Perceiving;
import com.hellblazer.luciferase.thoth.impl.Node;
import com.hellblazer.luciferase.thoth.impl.SphereOfInteraction;

Expand All @@ -32,73 +31,67 @@
public class SOI implements SphereOfInteraction {

@Override
public <T extends Perceiving> Node<T> closestTo(Tuple3f point3f) {
public Node closestTo(Tuple3f point3f) {
// TODO Auto-generated method stub
return null;
}

@Override
public <T extends Perceiving> Node<T> getAliased(Node<?> node) {
public Node getAliased(Node node) {
// TODO Auto-generated method stub
return null;
}

@Override
public Collection<Node<?>> getEnclosingNeighbors(Node<?> id) {
public Collection<Node> getEnclosingNeighbors(Node id) {
// TODO Auto-generated method stub
return null;
}

@Override
public Iterable<Node<?>> getNodes() {
public Iterable<Node> getNodes() {
// TODO Auto-generated method stub
return null;
}

@Override
public Collection<Node<?>> getPeers() {
// TODO Auto-generated method stub
return null;
}

@Override
public boolean includes(Node<?> node) {
public boolean includes(Node node) {
// TODO Auto-generated method stub
return false;
}

@Override
public <T extends Perceiving> void insert(Node<T> id, Tuple3f point3f) {
public void insert(Node id, Tuple3f point3f) {
// TODO Auto-generated method stub

}

@Override
public <T extends Perceiving> boolean isBoundary(Node<T> node, Tuple3f center, float radiusSquared) {
public boolean isBoundary(Node node, Tuple3f center, float radiusSquared) {
// TODO Auto-generated method stub
return false;
}

@Override
public boolean isEnclosing(Node<?> node, Node<?> center_node_id) {
public boolean isEnclosing(Node node, Node center_node_id) {
// TODO Auto-generated method stub
return false;
}

@Override
public boolean overlaps(Node<?> node, Tuple3f center, float radiusSquared) {
public boolean overlaps(Node node, Tuple3f center, float radiusSquared) {
// TODO Auto-generated method stub
return false;
}

@Override
public void remove(Node<?> node) {
public void remove(Node node) {
// TODO Auto-generated method stub

}

@Override
public void update(Node<?> node, Tuple3f coord) {
public void update(Node node, Tuple3f coord) {
// TODO Auto-generated method stub

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package com.hellblazer.luciferase.thoth.impl;

import java.util.Collection;
import java.util.UUID;

import javax.vecmath.Point3f;
import javax.vecmath.Tuple3f;
Expand All @@ -36,54 +35,36 @@
*
*/

abstract public class Node<E extends Perceiving> extends Vertex implements Cursor, Cloneable {
abstract public class Node extends Vertex implements Cursor, Cloneable {
private static final int BUFFER_MULTIPLIER = 2;
private static final long serialVersionUID = 1L;

protected float aoiRadius;
protected final UUID id;
protected float maximumVelocity;
protected float maxRadiusSquared;
protected E sim;
protected Perceiving sim;

public Node(E entity, UUID id, Point3f location, int aoiRadius, int maximumVelocity) {
public Node(Perceiving entity, Point3f location, int aoiRadius, int maximumVelocity) {
super(location);
this.sim = entity;
this.aoiRadius = aoiRadius;
this.id = id;
this.maximumVelocity = maximumVelocity;
int maxExtent = aoiRadius + maximumVelocity * BUFFER_MULTIPLIER;
this.maxRadiusSquared = maxExtent * maxExtent;
}

@Override
public Node<E> clone() {
@SuppressWarnings("unchecked")
final var clone = (Node<E>) super.clone();
public Node clone() {
final var clone = (Node) super.clone();
return clone;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if ((obj == null) || !(obj instanceof Node)) {
return false;
}
return id.equals(((Node<?>) obj).id);
}

abstract public void fadeFrom(Node<?> neighbor);
abstract public void fadeFrom(Node neighbor);

public float getAoiRadius() {
return aoiRadius;
}

public UUID getId() {
return id;
}

@Override
public Point3f getLocation() {
return new Point3f(this);
Expand All @@ -97,36 +78,23 @@ public float getMaximumVelocity() {
return maximumVelocity;
}

public E getSim() {
public Perceiving getSim() {
return sim;
}

@Override
public int hashCode() {
return id.hashCode();
}

abstract public void leave(Node<?> leaving);
abstract public void leave(Node leaving);

abstract public void move(Node<?> neighbor);
abstract public void move(Node neighbor);

abstract public void moveBoundary(Node<?> neighbor);
abstract public void moveBoundary(Node neighbor);

abstract public void noticeNodes(Collection<Node<?>> nodes);
abstract public void noticeNodes(Collection<Node> nodes);

abstract public void perceive(Node<?> neighbor);
abstract public void perceive(Node neighbor);

abstract public void query(Node<?> from, Node<?> joiner);
abstract public void query(Node from, Node joiner);

public void setLocation(Tuple3f location) {
super.set(location);
}

@Override
public String toString() {
String className = getClass().getCanonicalName();
int index = className.lastIndexOf('.');
return className.substring(index + 1) + " [" + id + "] (" + x + ", " + y + ", " + z + ") aoi: "
+ getAoiRadius();
}
}
Loading

0 comments on commit bf30eaa

Please sign in to comment.