Class ColtRandomSource

    • Constructor Detail

      • ColtRandomSource

        public ColtRandomSource​(ColtRandomSource actor)
        Construct the ColtRandomSource adapter.
        Parameters:
        actor - the associated actor.
    • Method Detail

      • generateInitializeCode

        public java.lang.String generateInitializeCode()
                                                throws IllegalActionException
        Generate the code for initializing the random number generator with the seed, if it has been given. A seed of zero is interpreted to mean that no seed is specified. In such cases, a seed based on the current time and this instance of a ColtRandomSource is used to be fairly sure that two identical sequences will not be returned.
        Overrides:
        generateInitializeCode in class NamedProgramCodeGeneratorAdapter
        Returns:
        The initialize code of this actor.
        Throws:
        IllegalActionException - Not thrown in this class.
      • _generateRandomNumber

        protected abstract java.lang.String _generateRandomNumber()
                                                           throws IllegalActionException
        Generate code for producing a new random number.
        Returns:
        The code that produces a new random number.
        Throws:
        IllegalActionException - Not thrown in this base class.