def fatten_component(self, c):
        """
        Fatten a component but resolving all references into the corresponding component type.

        @param c: Lean component to be fattened.
        @type c: lems.model.component.Component

        @return: Fattened component.
        @rtype: lems.model.component.FatComponent
        """
        if self.debug: print("Fattening %s"%c.id) 
        try:
            ct = self.component_types[c.type]
        except:
            raise ModelError("Unable to resolve type '{0}' for component '{1}'; existing: {2}",
                             c.type, c.id, self.component_types.keys())
        
        fc = FatComponent(c.id, c.type)
        if c.parent_id: fc.set_parent_id(c.parent_id)

        ### Resolve parameters
        for parameter in ct.parameters:
            if self.debug: print("Checking: %s"%parameter)
            if parameter.name in c.parameters:
                p = parameter.copy()
                p.value = c.parameters[parameter.name]
                p.numeric_value = self.get_numeric_value(p.value, p.dimension)
                fc.add_parameter(p)
            elif parameter.fixed:
                p = parameter.copy()
                p.numeric_value = self.get_numeric_value(p.value, p.dimension)
                fc.add_parameter(p)
            else:
                raise ModelError("Parameter '{0}' not initialized for component '{1}'",
                                 parameter.name, c.id)

        ### Resolve properties
        for property in ct.properties:
            property2 = property.copy()
            fc.add(property2)
            
        ### Resolve derived_parameters
        for derived_parameter in ct.derived_parameters:
            derived_parameter2 = derived_parameter.copy()
            fc.add(derived_parameter2)
            
        ### Resolve derived_parameters
        for index_parameter in ct.index_parameters:
            raise ModelError("IndexParameter not yet implemented in PyLEMS!")
            index_parameter2 = index_parameter.copy()
            fc.add(index_parameter2)
            
        ### Resolve constants
        for constant in ct.constants:
            constant2 = constant.copy()
            constant2.numeric_value = self.get_numeric_value(constant2.value, constant2.dimension)
            fc.add(constant2)

        ### Resolve texts
        for text in ct.texts:
            t = text.copy()
            t.value = c.parameters[text.name] if text.name in c.parameters else ''
            fc.add(t)
                
        ### Resolve texts
        for link in ct.links:
            if link.name in c.parameters:
                l = link.copy()
                l.value = c.parameters[link.name]
                fc.add(l)
            else:
                raise ModelError("Link parameter '{0}' not initialized for component '{1}'",
                                 link.name, c.id)
                
        ### Resolve paths
        for path in ct.paths:
            if path.name in c.parameters:
                p = path.copy()
                p.value = c.parameters[path.name]
                fc.add(p)
            else:
                raise ModelError("Path parameter '{0}' not initialized for component '{1}'",
                                 path.name, c.id)

        if len(ct.component_requirements)>0:
            raise ModelError("ComponentRequirement not yet implemented in PyLEMS!")
        if len(ct.instance_requirements)>0:
            raise ModelError("InstanceRequirement not yet implemented in PyLEMS!")

        ### Resolve component references.
        for cref in ct.component_references:
            if cref.local:
                raise ModelError("Attribute local on ComponentReference not yet implemented in PyLEMS!")
            if cref.name in c.parameters:
                cref2 = cref.copy()
                cid = c.parameters[cref.name]

                if cid not in self.fat_components:
                    self.add(self.fatten_component(self.components[cid]))

                cref2.referenced_component = self.fat_components[cid]
                fc.add(cref2)
            else:
                raise ModelError("Component reference '{0}' not initialized for component '{1}'",
                                 cref.name, c.id)
            
        merge_maps(fc.exposures, ct.exposures)
        merge_maps(fc.requirements, ct.requirements)
        merge_maps(fc.component_requirements, ct.component_requirements)
        merge_maps(fc.instance_requirements, ct.instance_requirements)
        merge_maps(fc.children, ct.children)
        merge_maps(fc.texts, ct.texts)
        merge_maps(fc.links, ct.links)
        merge_maps(fc.paths, ct.paths)
        merge_maps(fc.event_ports, ct.event_ports)
        merge_maps(fc.attachments, ct.attachments)

        fc.dynamics = ct.dynamics.copy()
        if len(fc.dynamics.regimes) != 0:
            fc.dynamics.clear()
               
        self.resolve_structure(fc, ct)
        self.resolve_simulation(fc, ct)

        fc.types = ct.types

        ### Resolve children
        for child in c.children:
            fc.add(self.fatten_component(child))

        return fc