Esempio n. 1
0
		private static Ptype CreatePtypeFromMutable(Mutable prototypebuildargs, Model[] models, Feature.Factory features, IEnumerable<Mutable> allptypes)
		{
			Dictionary<string, Bitmap> ptypefeatureshash = prototypebuildargs.Features;
			Dictionary<string,Feature> ptypefeatures = new Dictionary<string, Feature>();

			foreach (String fname in ptypefeatureshash.Keys)
			{
				Feature feature = features.Create(ptypefeatureshash[fname]);
				ptypefeatures.Add(fname, feature);
			}

			Model model = null;
			foreach(Model m in models)
				if(m.Name.Equals(prototypebuildargs.Model))
				{
					model = m;
					break;
				}


			Dictionary<string, Region> rdict = (Dictionary<string,Region>)new Dictionary<string,Region>(prototypebuildargs.Regions);


//            if (prototypebuildargs instanceof Hierarchical.HierarchicalMutable)
//            {
//                Hierarchical.HierarchicalMutable mhp = (Hierarchical.HierarchicalMutable)prototypebuildargs;
//                Dictionary<String, Ptype> children = new Dictionary<String, Ptype>();
//                for (int c = 0; c < mhp.childrenNames.size(); c++)
//                {
//                	Mutable ptype = null;
//                	for(Mutable p : allptypes){
//                		if(p.id.equals(mhp.children.get(c))){
//                			ptype = p;
//                			break;
//                		}
//                	}
//                    children.put(mhp.childrenNames.get(c),  createPtypeFromMutable( ptype, models, features, allptypes));
//                }
//                return new Hierarchical(mhp.id, fdict, rdict, model, children);
//            }
//            else
			return new Ptype(prototypebuildargs.Id, ptypefeatures, rdict, model);
		}
Esempio n. 2
0
			public Hierarchical(string guid, Dictionary<String, Feature> features,
				Dictionary<String, Region> regions, Model model, Dictionary<String, Ptype> children)
				: base(guid, features, regions, model)

			{
				this.children = children;
			}
Esempio n. 3
0
		private Ptype(Dictionary<string, Feature> features, Dictionary<string, Region> regions, Model model) : 
		this(Guid.NewGuid().ToString(), features, regions, model){


		}
Esempio n. 4
0
		private Ptype(string guid, Dictionary<string, Feature> features, Dictionary<string, Region> regions, Model model)
		{
			this.Model = model;
			this.Id = guid;
			this.features = features;
			this.regions = regions;
		}
Esempio n. 5
0
		public BuildPrototypeArgs(Examples examples, Model model, string id)
		{
			this.Id = id;
			this.examples = examples;
			this.Model = model;
		}