All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simdistalg.Sim_unidir_channel

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----eduni.simjava.Sim_entity
                   |
                   +----simdistalg.Sim_pos_entity
                           |
                           +----simdistalg.Sim_unidir_channel

public class Sim_unidir_channel
extends Sim_pos_entity
implements Sim_faulty_channel
This is a class to simulate a unidirectional message passing channel within the simjava simulation environment that can be faulty. It is used together with it`s companion class Sim_node.

See Also:
Sim_pos_entity, Sim_node, Sim_message_info, Sim_faulty_channel

Constructor Index

 o Sim_unidir_channel(String, String, String, String)
Create a new channel using default values.
 o Sim_unidir_channel(String, String, String, String, float, float, float, int, int, int)
Create a channel using special values for private members.
 o Sim_unidir_channel(String, String, String, String, float, float, float, int, int, int, int)
Create an animated channel using special values for private members and Sim_nodes as connected entities.
 o Sim_unidir_channel(String, String, String, String, int)
Create an animated channel with default values and Sim_nodes as connected entities.
 o Sim_unidir_channel(String, String, String, String, int, int, int, int, float, float, float, int, int, int, int)
Create an animated channel using special values for private members.
 o Sim_unidir_channel(String, String, String, String, int, int, int, int, int)
Create an animated channel with default values.

Method Index

 o body()
 o center_pos(int, int)
 o channel_delta_x(int, int, int, int)
 o channel_delta_y(int, int, int, int)
 o connect()
Connect the ports of the channel to it's neighbours.
 o debug(String)
 o determine_side(int, int, int, int)
 o down()
 o get_delay()
 o get_delay_minus()
 o get_delay_plus()
 o get_duplicate_rate()
 o get_loss_rate()
 o get_reordering_rate()
 o perturb()
 o reset()
 o set_delay(int)
A value below 0 is treated as zero.
 o set_delay_minus(int)
A value below 0 is treated as zero.
 o set_delay_plus(int)
A value below 0 is treated as zero.
 o set_duplicate_rate(float)
rates below 0 or above 1 are treated as 0 and 1 respectively.
 o set_loss_rate(float)
rates below 0 or above 1 are treated as 0 and 1 respectively.
 o set_reordering_rate(float)
rates below 0 or above 1 are treated as 0 and 1 respectively.
 o up()

Constructors

 o Sim_unidir_channel
 public Sim_unidir_channel(String in_nodename,
                           String in_portname,
                           String out_nodename,
                           String out_portname)
Create a new channel using default values.

Parameters:
in_nodename - Name of the node that issued messages into the channel
in_portname - Name of the port that connects to the channel's inport
out_nodename - Name of the node that receives messages over the channel
out_portname - Name of the port that connects to the channel's outport
 o Sim_unidir_channel
 public Sim_unidir_channel(String in_nodename,
                           String in_portname,
                           String out_nodename,
                           String out_portname,
                           float message_loss_rate,
                           float message_duplicate_rate,
                           float message_reordering_rate,
                           int message_delay,
                           int message_delay_plus,
                           int message_delay_minus)
Create a channel using special values for private members.

Parameters:
message_loss_rate - rate by which messages are lost (in percent)
message_duplicate_rate - rate by which messages are duplicated (in percent)
message_reordering_rate - rate by which messages are reordered (provided there is more than one message in the channel)
message_delay - average delay of a message (in simulation time units)
message_delay_plus - number of units by which messages can be slower
message_delay_minus - number of units by which messages can be faster
 o Sim_unidir_channel
 public Sim_unidir_channel(String in_nodename,
                           String in_portname,
                           String out_nodename,
                           String out_portname,
                           int x,
                           int y,
                           int inport_side,
                           int outport_side,
                           int stack_side)
Create an animated channel with default values.

Parameters:
x - x-coordinate of channel in simulation
y - y-coordinate of channel in simulation
inport_side - side of the ``in'' port of the channel (use values Anim_port.RIGHT etc.)
outport_side - side of the ``out'' port of the channel
stack_side - side at which to display the message stack
See Also:
Anim_port
 o Sim_unidir_channel
 public Sim_unidir_channel(String in_nodename,
                           String in_portname,
                           String out_nodename,
                           String out_portname,
                           int x,
                           int y,
                           int inport_side,
                           int outport_side,
                           float message_loss_rate,
                           float message_duplicate_rate,
                           float message_reordering_rate,
                           int message_delay,
                           int message_delay_plus,
                           int message_delay_minus,
                           int side)
Create an animated channel using special values for private members.

 o Sim_unidir_channel
 public Sim_unidir_channel(String in_nodename,
                           String in_portname,
                           String out_nodename,
                           String out_portname,
                           int side)
Create an animated channel with default values and Sim_nodes as connected entities.

See Also:
Sim_node
 o Sim_unidir_channel
 public Sim_unidir_channel(String in_nodename,
                           String in_portname,
                           String out_nodename,
                           String out_portname,
                           float message_loss_rate,
                           float message_duplicate_rate,
                           float message_reordering_rate,
                           int message_delay,
                           int message_delay_plus,
                           int message_delay_minus,
                           int side)
Create an animated channel using special values for private members and Sim_nodes as connected entities.

See Also:
Sim_node

Methods

 o get_loss_rate
 public float get_loss_rate()
 o set_loss_rate
 public void set_loss_rate(float rate)
rates below 0 or above 1 are treated as 0 and 1 respectively.

 o get_duplicate_rate
 public float get_duplicate_rate()
 o set_duplicate_rate
 public void set_duplicate_rate(float rate)
rates below 0 or above 1 are treated as 0 and 1 respectively.

 o get_reordering_rate
 public float get_reordering_rate()
 o set_reordering_rate
 public void set_reordering_rate(float rate)
rates below 0 or above 1 are treated as 0 and 1 respectively.

 o get_delay
 public int get_delay()
 o set_delay
 public void set_delay(int del)
A value below 0 is treated as zero.

 o get_delay_plus
 public int get_delay_plus()
 o set_delay_plus
 public void set_delay_plus(int del)
A value below 0 is treated as zero.

 o get_delay_minus
 public int get_delay_minus()
 o set_delay_minus
 public void set_delay_minus(int del)
A value below 0 is treated as zero.

 o connect
 public void connect()
Connect the ports of the channel to it's neighbours. (Call only when all ports have been created.)

 o down
 public void down()
 o up
 public void up()
 o reset
 public void reset()
 o perturb
 public void perturb()
 o body
 public void body()
Overrides:
body in class Sim_entity
 o center_pos
 public static int center_pos(int x1,
                              int x2)
 o determine_side
 public static int determine_side(int own_x,
                                  int own_y,
                                  int other_x,
                                  int other_y)
 o channel_delta_x
 public static int channel_delta_x(int from_x,
                                   int from_y,
                                   int to_x,
                                   int to_y)
 o channel_delta_y
 public static int channel_delta_y(int from_x,
                                   int from_y,
                                   int to_x,
                                   int to_y)
 o debug
 public void debug(String msg)

All Packages  Class Hierarchy  This Package  Previous  Next  Index