test_class.file: opendse-optimization/src/test/java/net/sf/opendse/optimization/io/SpecificationTransformerTypeBasedTest.java
test_class.identifier: SpecificationTransformerTypeBasedTest
test_case.body: @Test
  	public void generateMappingsTest() {
  
  		Resource r1 = new Resource("type1");
  		Resource r2 = new Resource("type2");
  
  		ResourceTypes<Resource> types = new ResourceTypes<Resource>();
  		types.put("r1", r1);
  		types.put("r2", r2);
  
  		Link l1 = new Link("linkType1");
  
  		LinkTypes<Link> linkTypes = new LinkTypes<Link>();
  		linkTypes.put("l1", l1);
  
  		Task t1 = new Task("t1");
  		Task t2 = new Task("t2");
  
  		Mappings<Task, Resource> typeMappings = new Mappings<Task, Resource>();
  
  		Mapping<Task, Resource> m1 = new Mapping<Task, Resource>("m1", t1, r1);
  		Mapping<Task, Resource> m2 = new Mapping<Task, Resource>("m2", t1, r2);
  		Mapping<Task, Resource> m3 = new Mapping<Task, Resource>("m3", t2, r1);
  		m3.setAttribute("M1", 0);
  
  		typeMappings.add(m1);
  		typeMappings.add(m2);
  		typeMappings.add(m3);
  
  		SpecificationTransformerTypeBased<SpecificationTypeBased, Specification> transformer = new SpecificationTransformerTypeBased<SpecificationTypeBased, Specification>();
  		Architecture<Resource, Link> arch = transformer.generateArchitecture(types, linkTypes);
  
  		Mappings<Task, Resource> mappings = transformer.generateMappings(typeMappings, arch);
  
  		Assert.assertNotNull(mappings);
  		Assert.assertEquals(mappings.size(), 3);
  
  		Assert.assertEquals(mappings.get(t1).size(), 2);
  		Assert.assertEquals(mappings.get(t2).size(), 1);
  		Assert.assertEquals(mappings.get(t2).iterator().next().getAttribute("M1"), 0);
  	}
test_case.class_method_signature: SpecificationTransformerTypeBasedTest.generateMappingsTest()
test_case.full_signature: @Test public void generateMappingsTest()
test_case.identifier: generateMappingsTest
test_case.invocations: put put put setAttribute add add add generateArchitecture generateMappings assertNotNull assertEquals size assertEquals size get assertEquals size get assertEquals getAttribute next iterator get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void generateMappingsTest()
focal_class.declarator: CONNECTOR = "_"
focal_class.modifier: protected final
focal_class.original_string: protected final String CONNECTOR = "_";
focal_class.type: String
focal_class.var_name: CONNECTOR
focal_class.declarator: typeMap
focal_class.modifier: protected
focal_class.original_string: protected Map<Resource, List<Resource>> typeMap;
focal_class.type: Map<Resource, List<Resource>>
focal_class.var_name: typeMap
focal_class.file: opendse-optimization/src/main/java/net/sf/opendse/optimization/io/SpecificationTransformerTypeBased.java
focal_class.identifier: SpecificationTransformerTypeBased
focal_class.interfaces: implements Transformer<T, S>
focal_class.class_method_signature: SpecificationTransformerTypeBased.transform(T typeBasedSpec)
focal_class.full_signature: @Override public S transform(T typeBasedSpec)
focal_class.identifier: transform
focal_class.modifiers: @Override public
focal_class.parameters: (T typeBasedSpec)
focal_class.return: S
focal_class.signature: S transform(T typeBasedSpec)
focal_class.class_method_signature: SpecificationTransformerTypeBased.generateArchitecture(ResourceTypes<Resource> resourceTypes,
  			LinkTypes<?> linkTypes)
focal_class.full_signature: protected Architecture<Resource, Link> generateArchitecture(ResourceTypes<Resource> resourceTypes,
  			LinkTypes<?> linkTypes)
focal_class.identifier: generateArchitecture
focal_class.modifiers: protected
focal_class.parameters: (ResourceTypes<Resource> resourceTypes,
  			LinkTypes<?> linkTypes)
focal_class.return: Architecture<Resource, Link>
focal_class.signature: Architecture<Resource, Link> generateArchitecture(ResourceTypes<Resource> resourceTypes,
  			LinkTypes<?> linkTypes)
focal_class.class_method_signature: SpecificationTransformerTypeBased.generateMappings(Mappings<Task, Resource> typeMappings,
  			Architecture<Resource, Link> architecture)
focal_class.full_signature: protected Mappings<Task, Resource> generateMappings(Mappings<Task, Resource> typeMappings,
  			Architecture<Resource, Link> architecture)
focal_class.identifier: generateMappings
focal_class.modifiers: protected
focal_class.parameters: (Mappings<Task, Resource> typeMappings,
  			Architecture<Resource, Link> architecture)
focal_class.return: Mappings<Task, Resource>
focal_class.signature: Mappings<Task, Resource> generateMappings(Mappings<Task, Resource> typeMappings,
  			Architecture<Resource, Link> architecture)
focal_method.body: protected Mappings<Task, Resource> generateMappings(Mappings<Task, Resource> typeMappings,
  			Architecture<Resource, Link> architecture) {
  
  		Mappings<Task, Resource> mappings = new Mappings<Task, Resource>();
  
  		// generate concrete mappings from type-mappings
  		for (Mapping<Task, Resource> typeMapping : typeMappings) {
  
  			Task source = typeMapping.getSource();
  			Resource target = typeMapping.getTarget();
  
  			Resource instance = architecture.getVertex("r" + CONNECTOR + target.getId());
  
  			Mapping<Task, Resource> mapping = new Mapping<Task, Resource>(
  					"m" + source.getId() + CONNECTOR + instance.getId(), source, instance);
  
  			Attributes attributes = typeMapping.getAttributes();
  			for (String key : attributes.keySet()) {
  				mapping.setAttribute(key, attributes.getAttribute(key));
  			}
  			mappings.add(mapping);
  		}
  		return mappings;
  	}
focal_method.class_method_signature: SpecificationTransformerTypeBased.generateMappings(Mappings<Task, Resource> typeMappings,
  			Architecture<Resource, Link> architecture)
focal_method.full_signature: protected Mappings<Task, Resource> generateMappings(Mappings<Task, Resource> typeMappings,
  			Architecture<Resource, Link> architecture)
focal_method.identifier: generateMappings
focal_method.invocations: getSource getTarget getVertex getId getId getId getAttributes keySet setAttribute getAttribute add
focal_method.modifiers: protected
focal_method.parameters: (Mappings<Task, Resource> typeMappings,
  			Architecture<Resource, Link> architecture)
focal_method.return: Mappings<Task, Resource>
focal_method.signature: Mappings<Task, Resource> generateMappings(Mappings<Task, Resource> typeMappings,
  			Architecture<Resource, Link> architecture)