コード例 #1
0
ファイル: Ptype.cs プロジェクト: nunb/interpretation
		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);
		}
コード例 #2
0
ファイル: Ptype.cs プロジェクト: nunb/interpretation
			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;
			}
コード例 #3
0
ファイル: Ptype.cs プロジェクト: nunb/interpretation
		private Ptype(Dictionary<string, Feature> features, Dictionary<string, Region> regions, Model model) : 
		this(Guid.NewGuid().ToString(), features, regions, model){


		}
コード例 #4
0
ファイル: Ptype.cs プロジェクト: nunb/interpretation
		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;
		}
コード例 #5
0
		public BuildPrototypeArgs(Examples examples, Model model, string id)
		{
			this.Id = id;
			this.examples = examples;
			this.Model = model;
		}