Exemplo n.º 1
0
        public void DefaultInit()
        {
            AddProperty(CpuSpeed, "CPU Speed", 8f);
            AddProperty(CpuCores, "CPU Cores", 1);
            AddProperty(Power, "Power", 50f);
            AddProperty(DiskSpeed, "Disk Speed", 0.1f);
            AddProperty(DiskCapacity, "Disk Capacity", 32f);
            AddProperty(MemorySpeed, "Memory Speed", 2f);
            AddProperty(MemoryCapacity, "Memory Capacity", 32f);

            AddProperty(CpuUsage, "CPU Usage", 0f);
            AddProperty(MemoryUsage, "Memory Usage", 0f);
            AddProperty(MemoryBusUsage, "Memory Bus Usage", 0f);
            AddProperty(DiskUsage, "Disk Usage", 0f);
            AddProperty(DiskBusUsage, "Disk Bus Usage", 0f);

            AddJob(RunDiagnostic, "Run Diagnostic", ResourceUsageSpec.DefaultProcessUsage());
            AddJob(ResetHardwareDefaults, "Reset Hardware Defaults", ResourceUsageSpec.DefaultProcessUsage());
            AddJob(RepairBootSector, "Repair Boot Sector", ResourceUsageSpec.DefaultProcessUsage());

            AddObjective(FullyBooted, "Fully Booted", new []
            {
                RunDiagnostic,
                ResetHardwareDefaults,
                RepairBootSector
            });

            AddProperty(TabsVisible, "Tabs Visible", false);
        }
Exemplo n.º 2
0
        public static ResourceUsageSpec ScaledUsageSpec(ResourceUsageSpec specBase, int iteration, float exponent)
        {
            ResourceUsageSpec ret = new ResourceUsageSpec(specBase);

            ret.Cycles *= Mathf.Pow(iteration, exponent);
            return(ret);
        }
Exemplo n.º 3
0
 private void AddRepeatableJob(int jobIndex, string name, ResourceUsageSpec resourceUsage, float exponent, List <int> requiredObjectives = null, Job.JobCompleted jobCompletedCallback = null)
 {
     if (jobs.ContainsKey(jobIndex))
     {
         throw new ArgumentException($"Job index {jobIndex} being reused");
     }
     jobs[jobIndex] = new RepeatableJob(jobIndex, name, resourceUsage, requiredObjectives?.Select(GetObjective).ToList(), jobCompletedCallback, exponent);
 }
Exemplo n.º 4
0
 public ResourceUsageSpec(ResourceUsageSpec other)
 {
     Index          = other.Index;
     Cycles         = other.Cycles;
     MemoryRatio    = other.MemoryRatio;
     DiskRatio      = other.DiskRatio;
     MemoryRequired = other.MemoryRequired;
     DiskRequired   = other.DiskRequired;
 }
Exemplo n.º 5
0
        private void AddResourceUsageTemplate(int resourceUsageIndex, ResourceUsageSpec spec)
        {
            if (resourceUsageTemplates.ContainsKey(resourceUsageIndex))
            {
                throw new ArgumentException($"Resource usage template index {resourceUsageIndex} being reused");
            }

            spec.Index = resourceUsageIndex;
            resourceUsageTemplates[resourceUsageIndex] = spec;
        }
Exemplo n.º 6
0
 public void AddRepeatableJob(string name, ResourceUsageSpec resourceUsage, float exponent, List <int> requiredObjectives = null, Job.JobCompleted jobCompletedCallback = null) =>
 AddRepeatableJob(globalIndexCount++, name, resourceUsage, exponent, requiredObjectives, jobCompletedCallback);
Exemplo n.º 7
0
 public void AddResourceUsageTemplate(ResourceUsageSpec spec) => AddResourceUsageTemplate(globalIndexCount++, spec);