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
-
Sim_unidir_channel(String, String, String, String)
- Create a new channel using default values.
-
Sim_unidir_channel(String, String, String, String, float, float, float, int, int, int)
- Create a channel using special values for private members.
-
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.
-
Sim_unidir_channel(String, String, String, String, int)
- Create an animated channel with default values and
Sim_nodes
as connected entities.
-
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.
-
Sim_unidir_channel(String, String, String, String, int, int, int, int, int)
- Create an animated channel with default values.
-
body()
-
-
center_pos(int, int)
-
-
channel_delta_x(int, int, int, int)
-
-
channel_delta_y(int, int, int, int)
-
-
connect()
- Connect the ports of the channel to it's neighbours.
-
debug(String)
-
-
determine_side(int, int, int, int)
-
-
down()
-
-
get_delay()
-
-
get_delay_minus()
-
-
get_delay_plus()
-
-
get_duplicate_rate()
-
-
get_loss_rate()
-
-
get_reordering_rate()
-
-
perturb()
-
-
reset()
-
-
set_delay(int)
- A value below 0 is treated as zero.
-
set_delay_minus(int)
- A value below 0 is treated as zero.
-
set_delay_plus(int)
- A value below 0 is treated as zero.
-
set_duplicate_rate(float)
- rates below 0 or above 1 are treated as 0 and 1 respectively.
-
set_loss_rate(float)
- rates below 0 or above 1 are treated as 0 and 1 respectively.
-
set_reordering_rate(float)
- rates below 0 or above 1 are treated as 0 and 1 respectively.
-
up()
-
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
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
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
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.
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
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
get_loss_rate
public float get_loss_rate()
set_loss_rate
public void set_loss_rate(float rate)
- rates below 0 or above 1 are treated as 0 and 1 respectively.
get_duplicate_rate
public float get_duplicate_rate()
set_duplicate_rate
public void set_duplicate_rate(float rate)
- rates below 0 or above 1 are treated as 0 and 1 respectively.
get_reordering_rate
public float get_reordering_rate()
set_reordering_rate
public void set_reordering_rate(float rate)
- rates below 0 or above 1 are treated as 0 and 1 respectively.
get_delay
public int get_delay()
set_delay
public void set_delay(int del)
- A value below 0 is treated as zero.
get_delay_plus
public int get_delay_plus()
set_delay_plus
public void set_delay_plus(int del)
- A value below 0 is treated as zero.
get_delay_minus
public int get_delay_minus()
set_delay_minus
public void set_delay_minus(int del)
- A value below 0 is treated as zero.
connect
public void connect()
- Connect the ports of the channel to it's neighbours. (Call only
when all ports have been created.)
down
public void down()
up
public void up()
reset
public void reset()
perturb
public void perturb()
body
public void body()
- Overrides:
- body in class Sim_entity
center_pos
public static int center_pos(int x1,
int x2)
determine_side
public static int determine_side(int own_x,
int own_y,
int other_x,
int other_y)
channel_delta_x
public static int channel_delta_x(int from_x,
int from_y,
int to_x,
int to_y)
channel_delta_y
public static int channel_delta_y(int from_x,
int from_y,
int to_x,
int to_y)
debug
public void debug(String msg)
All Packages Class Hierarchy This Package Previous Next Index