Esempio n. 1
0
        private static Dictionary <string, MachineId> CreateMachineIds(
            PSharpRuntime runtime,
            Type machineType,
            Func <int, string> machineNameFunc,
            int numMachines)
        {
            var result = new Dictionary <string, MachineId>();

            for (int i = 0; i < numMachines; i++)
            {
                var name      = machineNameFunc(i);
                var machineId = runtime.CreateMachineIdFromName(machineType, name);
                result[name] = machineId;
            }

            return(result);
        }