visidia.simulation.process.synchronization
Class SynchronizationObject

java.lang.Object
  extended by visidia.simulation.process.synchronization.SynchronizationObject
Direct Known Subclasses:
SynchronizationObjectTermination

public class SynchronizationObject
extends java.lang.Object

The class mother of Synchronization objects


Field Summary
 int arity
           
 int center
           
protected  boolean[] connected
           
protected  boolean[] edgMark
           
 boolean run
           
protected  java.util.Vector<java.lang.Integer> synchroCenters
           
 java.util.Vector<java.lang.Integer> synDoors
           
 int synState
           
 
Constructor Summary
SynchronizationObject()
           
 
Method Summary
 void addCenter(int i)
          Add a new center of synchronization.
 void addSynchronizedDoor(int i)
          Adds a new synchronized neighbour to synDoors (in synob).
 boolean allFinished()
           
 java.lang.Object clone()
           
 java.util.Vector<java.lang.Integer> getCenters()
          returns the centers of stars.
 int getDoor(int i)
          Returns the number of the door of synchronized neighbour in position i.
 boolean getMark(int neighbour)
           
 boolean hasFinished(int neighbour)
           
 void init(int ar)
          this method is used to initialize the structures.
 boolean isConnected(int i)
           
 boolean isElected()
          Returns true if the node is in elected state, returns false otherwise.
 boolean isInStar()
          Returns true if the node is in the star, returns false otherwise.
 boolean isNotInStar()
          Returns true if the node is in not the star, returns false otherwise.
 void reset()
          clears the structures.
 void resetCenters()
          vide l'ensemble des centres des etoites de synchronisation.
 boolean setConnected(int i, boolean b)
           
 void setFinished(int neighbour, boolean b)
           
 void setGlobEnd(boolean b)
           
 void setMark(int neighbour, boolean mark)
          Sets the mark of the neighbour to "mark"
 void setState(int synstate)
          Sets the synchronisation state of the node.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

synDoors

public java.util.Vector<java.lang.Integer> synDoors

edgMark

protected boolean[] edgMark

connected

protected boolean[] connected

synchroCenters

protected java.util.Vector<java.lang.Integer> synchroCenters

center

public int center

synState

public int synState

arity

public int arity

run

public boolean run
Constructor Detail

SynchronizationObject

public SynchronizationObject()
Method Detail

init

public void init(int ar)
this method is used to initialize the structures.

Parameters:
ar - the arity.

reset

public void reset()
clears the structures.


clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setState

public void setState(int synstate)
Sets the synchronisation state of the node.

Parameters:
synstate - possible values are defined in class SynCT

isElected

public boolean isElected()
Returns true if the node is in elected state, returns false otherwise.


isInStar

public boolean isInStar()
Returns true if the node is in the star, returns false otherwise.


isNotInStar

public boolean isNotInStar()
Returns true if the node is in not the star, returns false otherwise.


addSynchronizedDoor

public void addSynchronizedDoor(int i)
Adds a new synchronized neighbour to synDoors (in synob).


setMark

public void setMark(int neighbour,
                    boolean mark)
Sets the mark of the neighbour to "mark"

Parameters:
neighbour - the neighbour door.
mark - the new mark state.

getMark

public boolean getMark(int neighbour)

getDoor

public int getDoor(int i)
Returns the number of the door of synchronized neighbour in position i.

Parameters:
i - position in synDoors.

isConnected

public boolean isConnected(int i)

setConnected

public boolean setConnected(int i,
                            boolean b)

hasFinished

public boolean hasFinished(int neighbour)

allFinished

public boolean allFinished()

setGlobEnd

public void setGlobEnd(boolean b)

setFinished

public void setFinished(int neighbour,
                        boolean b)

resetCenters

public void resetCenters()
vide l'ensemble des centres des etoites de synchronisation.


addCenter

public void addCenter(int i)
Add a new center of synchronization.


getCenters

public java.util.Vector<java.lang.Integer> getCenters()
returns the centers of stars.