public class CoordinateWritable extends MiniCoordinateWritable
Modifier and Type | Field and Description |
---|---|
protected LongWritableSet |
analyzed
A set which contains all the ids of the vertices already taken into account.
|
protected float |
fX
The X component of the forces acting on the vertex.
|
protected float |
fY
The Y component of the forces acting on the vertex.
|
protected boolean |
justReset
A switch used to know if the vertex has been reset or not; it is used to check if whether to
include the attractive forces or not at the next propagator step.
|
protected float |
shortestEdge
The shortest incident edge.
|
component, oneEdges, x, y
Constructor and Description |
---|
CoordinateWritable() |
CoordinateWritable(java.lang.Float x,
java.lang.Float y,
int component) |
CoordinateWritable(float x,
float y,
org.json.JSONArray oEs,
int component) |
Modifier and Type | Method and Description |
---|---|
void |
addToForceVector(float[] force)
Adds to the internal force vector the values in the given 2-dimensional array.
|
void |
analyze(org.apache.hadoop.io.LongWritable neigh)
Set a new vertex as analyzed.
|
float[] |
getCoordinates() |
float[] |
getForceVector() |
float |
getShortestEdge() |
boolean |
hasBeenReset()
Returns true if the vertex has been reset (resetAnalyzed has been called during the last superstep).
|
boolean |
isAnalyzed(org.apache.hadoop.io.Writable neigh) |
void |
readFields(java.io.DataInput in) |
void |
resetAnalyzed()
At the end of a drawing cycle (seeding + propagation) this method resets the Analyzed set.
|
void |
resetForceVector() |
void |
setAsMoving()
When called, it means that for that vertex attractive forces have been already computed.
|
void |
setCoordinates(float x,
float y) |
void |
setShortestEdge(float shortestEdge) |
void |
write(java.io.DataOutput out) |
getComponent, getOneDegreeVertices, getOneDegreeVerticesQuantity
protected LongWritableSet analyzed
protected float fX
protected float fY
protected boolean justReset
protected float shortestEdge
public CoordinateWritable()
public CoordinateWritable(java.lang.Float x, java.lang.Float y, int component)
public CoordinateWritable(float x, float y, org.json.JSONArray oEs, int component) throws org.json.JSONException
org.json.JSONException
public void addToForceVector(float[] force)
force
- The array to add to the internal force array.public void analyze(org.apache.hadoop.io.LongWritable neigh)
neigh
- The vertex id to be set as analyzed.public float[] getCoordinates()
getCoordinates
in class MiniCoordinateWritable
public float[] getForceVector()
public float getShortestEdge()
public boolean hasBeenReset()
public boolean isAnalyzed(org.apache.hadoop.io.Writable neigh)
public void readFields(java.io.DataInput in) throws java.io.IOException
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class MiniCoordinateWritable
java.io.IOException
public void resetAnalyzed()
public void resetForceVector()
public void setAsMoving()
public void setCoordinates(float x, float y)
setCoordinates
in class MiniCoordinateWritable
public void setShortestEdge(float shortestEdge)
public void write(java.io.DataOutput out) throws java.io.IOException
write
in interface org.apache.hadoop.io.Writable
write
in class MiniCoordinateWritable
java.io.IOException