示例#1
0
 public Purpose(Common.Purpose p, City o, City ct, Common.Resource rt)
 {
     purpose        = p;
     owner          = o;
     cityTarget     = ct;
     resourceTarget = rt;
 }
示例#2
0
        public EstimationResult Estimate(IDictionary <string, string> parameters, Common.Resource resource, Common.LaunchDestination destination, bool optimize)
        {
            var models = new List <IModel>();

            models.AddRange(_models.Values);
            models.Sort(new ModelOrderer());
            EstimationResult result = null;

            foreach (var model in models)
            {
                var hwParameters = model.GetParameters(ParameterSourceType.Hardware);
                foreach (var hwParameter in hwParameters)
                {
                    model.SetParameterValue(hwParameter.Name, ClusterParameterReader.GetValue(hwParameter.Name, resource, destination));
                }
                result = model.Estimate(parameters, result, optimize);
            }
            if (!result.Parameters.Exists(p => p.Name == NodesCountExtractor.NODES))
            {
                result.Parameters.Add(new EstimationResult.ParameterValue()
                {
                    Name         = NodesCountExtractor.NODES,
                    InitialValue = (1).ToString(),
                    NewValue     = (1).ToString()
                });
            }
            if (!result.Parameters.Exists(p => p.Name == ProcessorCountPerNode.P))
            {
                result.Parameters.Add(new EstimationResult.ParameterValue()
                {
                    Name         = ProcessorCountPerNode.P,
                    InitialValue = (1).ToString(),
                    NewValue     = (1).ToString()
                });
            }
            return(result);
        }
示例#3
0
 public void SetActivity(Common.CombatMessage.Activity activity, int handle, Common.Resource activityObject, Objects.Unit performer, Objects.Unit target)
 {
     currentActivity = activity;
     currentHandle = handle;
     currentActivityObject = activityObject;
     currentPerformer = performer;
     currentTarget = target;
 }
示例#4
0
 public Shortage(Common.Resource r)
 {
     resource = r;
 }