Package org.jcsp.plugNplay.ints
Class RegularInt
- java.lang.Object
-
- org.jcsp.plugNplay.ints.RegularInt
-
- All Implemented Interfaces:
CSProcess
public class RegularInt extends java.lang.Object implements CSProcess
This process generates a constant stream of Integers at a regular rate.Process Diagram
________________ | | out | RegularInt (n) |-->-- |________________|
Description
This process generates a constant stream of Integers at a regular rate – at least, it does its best! If the consumption of data is less than the set rate, that rate cannot be sustained. If the consumption failure is only temporary, the set rate will be restored when consumption resumes.The interval (in msecs) defining the output flow rate is given by a constructor argument.
Channel Protocols
Output Channels out int A constant value is sent down this channel at a regular rate. - See Also:
FixedDelayInt
,RegulateInt
-
-
Field Summary
Fields Modifier and Type Field Description private long
interval
private int
n
private ChannelOutputInt
out
-
Constructor Summary
Constructors Constructor Description RegularInt(ChannelOutputInt out, int n, long interval)
Construct the process.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
The main body of this process.
-
-
-
Field Detail
-
out
private final ChannelOutputInt out
-
n
private final int n
-
interval
private final long interval
-
-
Constructor Detail
-
RegularInt
public RegularInt(ChannelOutputInt out, int n, long interval)
Construct the process.- Parameters:
out
- the output channeln
- the value to be generatedinterval
- the interval between outputs (in milliseconds)
-
-