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 generateArchitectureTest() {
  
  		Resource r1 = new Resource("type1");
  		r1.setAttribute("A1", 5);
  		r1.setAttribute("A2", 1);
  
  		Resource r2 = new Resource("type2");
  		r2.setAttribute("A1", 0);
  
  		ResourceTypes<Resource> types = new ResourceTypes<Resource>();
  		types.put("r1", r1);
  		types.put("r2", r2);
  
  		Link l1 = new Link("linkType1");
  		l1.setAttribute("B1", 2);
  
  		LinkTypes<Link> linkTypes = new LinkTypes<Link>();
  		linkTypes.put("l1", l1);
  
  		SpecificationTransformerTypeBased<SpecificationTypeBased, Specification> transformer = new SpecificationTransformerTypeBased<SpecificationTypeBased, Specification>();
  
  		Architecture<Resource, Link> arch = transformer.generateArchitecture(types, linkTypes);
  
  		Assert.assertNotNull(arch);
  		Assert.assertEquals(arch.getVertexCount(), 3);
  
  		Assert.assertNotNull(arch.getVertex("r_type1"));
  		Assert.assertNotNull(arch.getVertex("r_type2"));
  		Assert.assertNotNull(arch.getVertex("bus"));
  
  		Assert.assertNotNull(arch.getEdge("l_type1"));
  		Assert.assertNotNull(arch.getEdge("l_type2"));
  
  		Assert.assertEquals(arch.getVertex("r_type1").getAttribute("A1"), 5);
  		Assert.assertEquals(arch.getVertex("r_type1").getAttribute("A2"), 1);
  
  		Assert.assertEquals(arch.getVertex("r_type1").getType(), "type1");
  		Assert.assertEquals(arch.getEdge("l_type1").getAttribute("B1"), 2);
  
  		Assert.assertNotEquals(arch.getVertex("r_type1"), types.get("type1"));
  	}
test_case.class_method_signature: SpecificationTransformerTypeBasedTest.generateArchitectureTest()
test_case.full_signature: @Test public void generateArchitectureTest()
test_case.identifier: generateArchitectureTest
test_case.invocations: setAttribute setAttribute setAttribute put put setAttribute put generateArchitecture assertNotNull assertEquals getVertexCount assertNotNull getVertex assertNotNull getVertex assertNotNull getVertex assertNotNull getEdge assertNotNull getEdge assertEquals getAttribute getVertex assertEquals getAttribute getVertex assertEquals getType getVertex assertEquals getAttribute getEdge assertNotEquals getVertex get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void generateArchitectureTest()
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 Architecture<Resource, Link> generateArchitecture(ResourceTypes<Resource> resourceTypes,
  			LinkTypes<?> linkTypes) {
  
  		Architecture<Resource, Link> architecture = new Architecture<Resource, Link>();
  		Link linkType = linkTypes.values().iterator().next();
  
  		// on-chip bus
  		Resource bus = new Resource("bus");
  
  		for (Resource type : resourceTypes.values()) {
  			Resource instance = new Resource("r" + CONNECTOR + type.getId());
  
  			Attributes attributes = type.getAttributes();
  			for (String key : attributes.keySet()) {
  				instance.setAttribute(key, attributes.getAttribute(key));
  			}
  			instance.setType(type.getId());
  
  			Link link = new Link("l" + CONNECTOR + type.getId());
  
  			Attributes linkAttributes = linkType.getAttributes();
  			for (String key : linkAttributes.keySet()) {
  				link.setAttribute(key, linkAttributes.getAttribute(key));
  			}
  
  			architecture.addVertex(instance);
  			architecture.addEdge(link, instance, bus);
  		}
  		return architecture;
  	}
focal_method.class_method_signature: SpecificationTransformerTypeBased.generateArchitecture(ResourceTypes<Resource> resourceTypes,
  			LinkTypes<?> linkTypes)
focal_method.full_signature: protected Architecture<Resource, Link> generateArchitecture(ResourceTypes<Resource> resourceTypes,
  			LinkTypes<?> linkTypes)
focal_method.identifier: generateArchitecture
focal_method.invocations: next iterator values values getId getAttributes keySet setAttribute getAttribute setType getId getId getAttributes keySet setAttribute getAttribute addVertex addEdge
focal_method.modifiers: protected
focal_method.parameters: (ResourceTypes<Resource> resourceTypes,
  			LinkTypes<?> linkTypes)
focal_method.return: Architecture<Resource, Link>
focal_method.signature: Architecture<Resource, Link> generateArchitecture(ResourceTypes<Resource> resourceTypes,
  			LinkTypes<?> linkTypes)