Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new machine of the given type with an optional payload.
        /// </summary>
        /// <param name="type">Type of the machine</param>
        /// <param name="payload">Optional payload</param>
        /// <returns>Machine id</returns>
        public static MachineId CreateMachine(Type type, params Object[] payload)
        {
            lock (PSharpRuntime.Lock)
            {
                if (!PSharpRuntime.IsRunning)
                {
                    PSharpRuntime.Initialize();
                }
            }

            return(PSharpRuntime.TryCreateMachine(type, payload));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Tries to create a new remote machine of the given type with an optional payload.
 /// </summary>
 /// <param name="type">Type of the machine</param>
 /// <param name="payload">Optional payload</param>
 /// <returns>Machine id</returns>
 MachineId IDispatcher.TryCreateRemoteMachine(Type type, params Object[] payload)
 {
     // Remote does not work in the bug-finding runtime.
     return(PSharpRuntime.TryCreateMachine(type, payload));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Tries to create a new machine of the given type with an optional payload.
 /// </summary>
 /// <param name="type">Type of the machine</param>
 /// <param name="payload">Optional payload</param>
 /// <returns>Machine id</returns>
 MachineId IDispatcher.TryCreateMachine(Type type, params Object[] payload)
 {
     return(PSharpRuntime.TryCreateMachine(type, payload));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a new machine of the given type with an optional payload.
 /// </summary>
 /// <param name="type">Type of the machine</param>
 /// <param name="payload">Optional payload</param>
 /// <returns>Machine id</returns>
 public static MachineId CreateMachine(Type type, params Object[] payload)
 {
     // TODO: remove
     Configuration.Debug.Contains(DebugType.All);
     return(PSharpRuntime.TryCreateMachine(type, payload));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Creates a new machine of the given type with an optional payload.
 /// </summary>
 /// <param name="type">Type of the machine</param>
 /// <param name="payload">Optional payload</param>
 /// <returns>Machine id</returns>
 public static MachineId CreateMachine(Type type, params Object[] payload)
 {
     return(PSharpRuntime.TryCreateMachine(type, payload));
 }