public Configuration()
 {
     EnvironmentSettings = new Environment();
     AgentSettings = new Agent();
     TagSettings = new Tag();
     ResourceSettings = new Resource();
 }
 public UniqueIdentifier(IdentityType type, Resource[] genome)
 {
     this.type = type;
     this.genome = genome;
 }
Esempio n. 3
0
        public static Tag New(Resource[] resources)
        {
            if (resources == null) throw new ArgumentNullException("resources");

            return new Tag(resources.Select(r => r.Label).ToArray());
        }
        public void MyTestInitialize()
        {
            var config = new Configuration();
            config.ResourceSettings.AllowWildcards = false;
            config.ResourceSettings.Count = 4;
            config.ResourceSettings.NormalToWildcardRatio = 1;

            Resource.Initialize(config);

            A = Resource.Get(0);
            B = Resource.Get(1);
            C = Resource.Get(2);
            D = Resource.Get(3);
        }
Esempio n. 5
0
 static Resource()
 {
     resourceList = new List<Resource>();
     resourceMap = new Dictionary<char, Resource>();
     wildcardResource = new Resource(WildcardResourceCharacter);
 }
Esempio n. 6
0
        /// <summary>
        /// Populate the Resource Map with resource characters from 'a' to 'a'+numberOfResources.
        /// </summary>
        public static void Initialize(Configuration config)
        {
            NormalToWildcardRatio = config.ResourceSettings.NormalToWildcardRatio;
            GlobalAllowWildcard = config.ResourceSettings.AllowWildcards;

            resourceList.Clear();
            resourceMap.Clear();
            for (int i = 0; i < config.ResourceSettings.Count; i++)
            {
                char c = Convert.ToChar(Convert.ToInt32(FirstResourceCharacter) + i);
                var r = new Resource(c);
                resourceList.Add(r);
                resourceMap.Add(c, r);
            }
        }