/*******************************************************************************
 * Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0
 *
 * Contributors:
 *     Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
 *******************************************************************************/
/**
 */
package com.irtsaintexupery.pseim.pseim.impl;

import com.irtsaintexupery.pseim.pseim.CardinalityElement;
import com.irtsaintexupery.pseim.pseim.IdentifiedElement;
import com.irtsaintexupery.pseim.pseim.Library;
import com.irtsaintexupery.pseim.pseim.LinkType;
import com.irtsaintexupery.pseim.pseim.MultiplicityElement;
import com.irtsaintexupery.pseim.pseim.Pattern;
import com.irtsaintexupery.pseim.pseim.PatternComponent;
import com.irtsaintexupery.pseim.pseim.PatternLink;
import com.irtsaintexupery.pseim.pseim.PatternPort;
import com.irtsaintexupery.pseim.pseim.PatternPortDirection;
import com.irtsaintexupery.pseim.pseim.PatternTypeFailureMode;
import com.irtsaintexupery.pseim.pseim.PatternTypeHS;
import com.irtsaintexupery.pseim.pseim.PseimFactory;
import com.irtsaintexupery.pseim.pseim.PseimPackage;
import com.irtsaintexupery.pseim.pseim.SafetyTactic;

import com.irtsaintexupery.pseim.pseim.util.PseimValidator;
import com.irtsaintexupery.pseim.seim.SeimPackage;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.EValidator;
import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class PseimPackageImpl extends EPackageImpl implements PseimPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass libraryEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass patternEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass cardinalityElementEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass patternComponentEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass patternPortEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass patternLinkEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass multiplicityElementEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass identifiedElementEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum patternTypeHSEEnum = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum patternTypeFailureModeEEnum = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum safetyTacticEEnum = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum linkTypeEEnum = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum patternPortDirectionEEnum = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see com.irtsaintexupery.pseim.pseim.PseimPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private PseimPackageImpl() {
		super(eNS_URI, PseimFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link PseimPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static PseimPackage init() {
		if (isInited)
			return (PseimPackage) EPackage.Registry.INSTANCE.getEPackage(PseimPackage.eNS_URI);

		// Obtain or create and register package
		PseimPackageImpl thePseimPackage = (PseimPackageImpl) (EPackage.Registry.INSTANCE
				.get(eNS_URI) instanceof PseimPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
						: new PseimPackageImpl());

		isInited = true;

		// Initialize simple dependencies
		SeimPackage.eINSTANCE.eClass();

		// Create package meta-data objects
		thePseimPackage.createPackageContents();

		// Initialize created meta-data
		thePseimPackage.initializePackageContents();

		// Register package validator
		EValidator.Registry.INSTANCE.put(thePseimPackage, new EValidator.Descriptor() {
			public EValidator getEValidator() {
				return PseimValidator.INSTANCE;
			}
		});

		// Mark meta-data to indicate it can't be changed
		thePseimPackage.freeze();

		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(PseimPackage.eNS_URI, thePseimPackage);
		return thePseimPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getLibrary() {
		return libraryEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getLibrary_Patterns() {
		return (EReference) libraryEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPattern() {
		return patternEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPattern_TypeHS() {
		return (EAttribute) patternEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPattern_TypeFailure() {
		return (EAttribute) patternEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPattern_AlsoKnownAs() {
		return (EAttribute) patternEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPattern_UsedTactics() {
		return (EAttribute) patternEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPattern_Context() {
		return (EAttribute) patternEClass.getEStructuralFeatures().get(4);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPattern_Domain() {
		return (EAttribute) patternEClass.getEStructuralFeatures().get(5);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPattern_IsSingleChannel() {
		return (EAttribute) patternEClass.getEStructuralFeatures().get(6);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getPattern_InterfaceElements() {
		return (EReference) patternEClass.getEStructuralFeatures().get(7);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getPattern_CardinalityElements() {
		return (EReference) patternEClass.getEStructuralFeatures().get(8);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getCardinalityElement() {
		return cardinalityElementEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getCardinalityElement_CalculatedVia() {
		return (EReference) cardinalityElementEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPatternComponent() {
		return patternComponentEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPatternComponent_MergeContent() {
		return (EAttribute) patternComponentEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPatternPort() {
		return patternPortEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPatternPort_Dir() {
		return (EAttribute) patternPortEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPatternLink() {
		return patternLinkEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPatternLink_LinkType() {
		return (EAttribute) patternLinkEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getPatternLink_Element() {
		return (EReference) patternLinkEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMultiplicityElement() {
		return multiplicityElementEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getMultiplicityElement_MultiplicityValue() {
		return (EAttribute) multiplicityElementEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMultiplicityElement_CardinalityElement() {
		return (EReference) multiplicityElementEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getIdentifiedElement() {
		return identifiedElementEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getIdentifiedElement_IdentifiedAs() {
		return (EReference) identifiedElementEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getPatternTypeHS() {
		return patternTypeHSEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getPatternTypeFailureMode() {
		return patternTypeFailureModeEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getSafetyTactic() {
		return safetyTacticEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getLinkType() {
		return linkTypeEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getPatternPortDirection() {
		return patternPortDirectionEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PseimFactory getPseimFactory() {
		return (PseimFactory) getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated)
			return;
		isCreated = true;

		// Create classes and their features
		libraryEClass = createEClass(LIBRARY);
		createEReference(libraryEClass, LIBRARY__PATTERNS);

		patternEClass = createEClass(PATTERN);
		createEAttribute(patternEClass, PATTERN__TYPE_HS);
		createEAttribute(patternEClass, PATTERN__TYPE_FAILURE);
		createEAttribute(patternEClass, PATTERN__ALSO_KNOWN_AS);
		createEAttribute(patternEClass, PATTERN__USED_TACTICS);
		createEAttribute(patternEClass, PATTERN__CONTEXT);
		createEAttribute(patternEClass, PATTERN__DOMAIN);
		createEAttribute(patternEClass, PATTERN__IS_SINGLE_CHANNEL);
		createEReference(patternEClass, PATTERN__INTERFACE_ELEMENTS);
		createEReference(patternEClass, PATTERN__CARDINALITY_ELEMENTS);

		cardinalityElementEClass = createEClass(CARDINALITY_ELEMENT);
		createEReference(cardinalityElementEClass, CARDINALITY_ELEMENT__CALCULATED_VIA);

		patternComponentEClass = createEClass(PATTERN_COMPONENT);
		createEAttribute(patternComponentEClass, PATTERN_COMPONENT__MERGE_CONTENT);

		patternPortEClass = createEClass(PATTERN_PORT);
		createEAttribute(patternPortEClass, PATTERN_PORT__DIR);

		patternLinkEClass = createEClass(PATTERN_LINK);
		createEAttribute(patternLinkEClass, PATTERN_LINK__LINK_TYPE);
		createEReference(patternLinkEClass, PATTERN_LINK__ELEMENT);

		multiplicityElementEClass = createEClass(MULTIPLICITY_ELEMENT);
		createEAttribute(multiplicityElementEClass, MULTIPLICITY_ELEMENT__MULTIPLICITY_VALUE);
		createEReference(multiplicityElementEClass, MULTIPLICITY_ELEMENT__CARDINALITY_ELEMENT);

		identifiedElementEClass = createEClass(IDENTIFIED_ELEMENT);
		createEReference(identifiedElementEClass, IDENTIFIED_ELEMENT__IDENTIFIED_AS);

		// Create enums
		patternTypeHSEEnum = createEEnum(PATTERN_TYPE_HS);
		patternTypeFailureModeEEnum = createEEnum(PATTERN_TYPE_FAILURE_MODE);
		safetyTacticEEnum = createEEnum(SAFETY_TACTIC);
		linkTypeEEnum = createEEnum(LINK_TYPE);
		patternPortDirectionEEnum = createEEnum(PATTERN_PORT_DIRECTION);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized)
			return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		SeimPackage theSeimPackage = (SeimPackage) EPackage.Registry.INSTANCE.getEPackage(SeimPackage.eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		libraryEClass.getESuperTypes().add(theSeimPackage.getNamedElement());
		patternEClass.getESuperTypes().add(theSeimPackage.getModel());
		cardinalityElementEClass.getESuperTypes().add(theSeimPackage.getPropertyHolder());
		patternComponentEClass.getESuperTypes().add(this.getMultiplicityElement());
		patternComponentEClass.getESuperTypes().add(this.getIdentifiedElement());
		patternComponentEClass.getESuperTypes().add(theSeimPackage.getComponent());
		patternPortEClass.getESuperTypes().add(this.getMultiplicityElement());
		patternPortEClass.getESuperTypes().add(this.getIdentifiedElement());
		patternPortEClass.getESuperTypes().add(theSeimPackage.getPort());
		patternLinkEClass.getESuperTypes().add(this.getIdentifiedElement());
		patternLinkEClass.getESuperTypes().add(theSeimPackage.getLink());

		// Initialize classes, features, and operations; add parameters
		initEClass(libraryEClass, Library.class, "Library", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getLibrary_Patterns(), this.getPattern(), null, "patterns", null, 0, -1, Library.class,
				!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
				IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(patternEClass, Pattern.class, "Pattern", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getPattern_TypeHS(), this.getPatternTypeHS(), "typeHS", null, 0, -1, Pattern.class,
				!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
				!IS_ORDERED);
		initEAttribute(getPattern_TypeFailure(), this.getPatternTypeFailureMode(), "typeFailure", null, 0, 1,
				Pattern.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
				!IS_DERIVED, IS_ORDERED);
		initEAttribute(getPattern_AlsoKnownAs(), ecorePackage.getEString(), "alsoKnownAs", null, 0, -1, Pattern.class,
				!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
				!IS_ORDERED);
		initEAttribute(getPattern_UsedTactics(), this.getSafetyTactic(), "usedTactics", null, 0, -1, Pattern.class,
				!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
				!IS_ORDERED);
		initEAttribute(getPattern_Context(), ecorePackage.getEString(), "context", null, 0, 1, Pattern.class,
				!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getPattern_Domain(), ecorePackage.getEString(), "domain", null, 0, 1, Pattern.class,
				!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getPattern_IsSingleChannel(), ecorePackage.getEBoolean(), "isSingleChannel", null, 1, 1,
				Pattern.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
				!IS_DERIVED, IS_ORDERED);
		initEReference(getPattern_InterfaceElements(), theSeimPackage.getPropertyHolder(), null, "interfaceElements",
				null, 0, -1, Pattern.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
				IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getPattern_CardinalityElements(), this.getCardinalityElement(), null, "cardinalityElements",
				null, 0, -1, Pattern.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
				!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(cardinalityElementEClass, CardinalityElement.class, "CardinalityElement", !IS_ABSTRACT,
				!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getCardinalityElement_CalculatedVia(), theSeimPackage.getPropertyHolder(), null, "calculatedVia",
				null, 0, -1, CardinalityElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
				IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(patternComponentEClass, PatternComponent.class, "PatternComponent", !IS_ABSTRACT, !IS_INTERFACE,
				IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getPatternComponent_MergeContent(), ecorePackage.getEBoolean(), "mergeContent", null, 1, 1,
				PatternComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
				!IS_DERIVED, IS_ORDERED);

		initEClass(patternPortEClass, PatternPort.class, "PatternPort", !IS_ABSTRACT, !IS_INTERFACE,
				IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getPatternPort_Dir(), this.getPatternPortDirection(), "dir", null, 1, 1, PatternPort.class,
				!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(patternLinkEClass, PatternLink.class, "PatternLink", !IS_ABSTRACT, !IS_INTERFACE,
				IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getPatternLink_LinkType(), this.getLinkType(), "linkType", null, 1, 1, PatternLink.class,
				!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getPatternLink_Element(), this.getCardinalityElement(), null, "element", null, 0, 1,
				PatternLink.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(multiplicityElementEClass, MultiplicityElement.class, "MultiplicityElement", IS_ABSTRACT,
				IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getMultiplicityElement_MultiplicityValue(), ecorePackage.getEInt(), "multiplicityValue", "1", 1,
				1, MultiplicityElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID,
				IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getMultiplicityElement_CardinalityElement(), this.getCardinalityElement(), null,
				"cardinalityElement", null, 0, 1, MultiplicityElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
				!IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(identifiedElementEClass, IdentifiedElement.class, "IdentifiedElement", IS_ABSTRACT, IS_INTERFACE,
				IS_GENERATED_INSTANCE_CLASS);
		initEReference(getIdentifiedElement_IdentifiedAs(), theSeimPackage.getPropertyHolder(), null, "identifiedAs",
				null, 0, 1, IdentifiedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
				IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Initialize enums and add enum literals
		initEEnum(patternTypeHSEEnum, PatternTypeHS.class, "PatternTypeHS");
		addEEnumLiteral(patternTypeHSEEnum, PatternTypeHS.HARDWARE);
		addEEnumLiteral(patternTypeHSEEnum, PatternTypeHS.SOFTWARE);

		initEEnum(patternTypeFailureModeEEnum, PatternTypeFailureMode.class, "PatternTypeFailureMode");
		addEEnumLiteral(patternTypeFailureModeEEnum, PatternTypeFailureMode.FAIL_SAFE);
		addEEnumLiteral(patternTypeFailureModeEEnum, PatternTypeFailureMode.FAIL_OVER);

		initEEnum(safetyTacticEEnum, SafetyTactic.class, "SafetyTactic");
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.SIMPLICITY);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.SUBSTITUTION);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.SANITY_CHECK);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.CONDITION_MONITORING);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.COMPARISON);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.DIVERSE_REDUNDANCY);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.REPLICATION_REDUNDANCY);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.REPAIR);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.DEGRADATION);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.VOTING);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.OVERRIDE);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.BARRIER);
		addEEnumLiteral(safetyTacticEEnum, SafetyTactic.HEARTBEAT);

		initEEnum(linkTypeEEnum, LinkType.class, "LinkType");
		addEEnumLiteral(linkTypeEEnum, LinkType.TRANSPOSE);
		addEEnumLiteral(linkTypeEEnum, LinkType.IDENTITY);
		addEEnumLiteral(linkTypeEEnum, LinkType.SHIFTC);
		addEEnumLiteral(linkTypeEEnum, LinkType.FIRST);
		addEEnumLiteral(linkTypeEEnum, LinkType.ROTATE);
		addEEnumLiteral(linkTypeEEnum, LinkType.JOINC);
		addEEnumLiteral(linkTypeEEnum, LinkType.JOINP);
		addEEnumLiteral(linkTypeEEnum, LinkType.FORKC);
		addEEnumLiteral(linkTypeEEnum, LinkType.FORKP);
		addEEnumLiteral(linkTypeEEnum, LinkType.SHIFTP);
		addEEnumLiteral(linkTypeEEnum, LinkType.FLATTENC);
		addEEnumLiteral(linkTypeEEnum, LinkType.LAST);

		initEEnum(patternPortDirectionEEnum, PatternPortDirection.class, "PatternPortDirection");
		addEEnumLiteral(patternPortDirectionEEnum, PatternPortDirection.UNSPECIFIED);
		addEEnumLiteral(patternPortDirectionEEnum, PatternPortDirection.IN);
		addEEnumLiteral(patternPortDirectionEEnum, PatternPortDirection.OUT);
		addEEnumLiteral(patternPortDirectionEEnum, PatternPortDirection.INOUT);

		// Create resource
		createResource(eNS_URI);

		// Create annotations
		// http://www.eclipse.org/OCL/Import
		createImportAnnotations();
		// http://www.eclipse.org/emf/2002/Ecore
		createEcoreAnnotations();
		// http://www.eclipse.org/OCL/Collection
		createCollectionAnnotations();
		// http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot
		createPivotAnnotations();
	}

	/**
	 * Initializes the annotations for <b>http://www.eclipse.org/OCL/Import</b>.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void createImportAnnotations() {
		String source = "http://www.eclipse.org/OCL/Import";
		addAnnotation(this, source,
				new String[] { "ecore", "http://www.eclipse.org/emf/2002/Ecore", "seim", "seim.ecore#/" });
	}

	/**
	 * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void createEcoreAnnotations() {
		String source = "http://www.eclipse.org/emf/2002/Ecore";
		addAnnotation(this, source,
				new String[] { "invocationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
						"settingDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "validationDelegates",
						"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot" });
		addAnnotation(patternComponentEClass, source, new String[] { "constraints", "contentIsPatternContent" });
		addAnnotation(patternLinkEClass, source, new String[] { "constraints", "srcIsPatternPort dstIsPatternPort" });
		addAnnotation(multiplicityElementEClass, source, new String[] { "constraints", "cardinalityAsElementOrMult" });
	}

	/**
	 * Initializes the annotations for <b>http://www.eclipse.org/OCL/Collection</b>.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void createCollectionAnnotations() {
		String source = "http://www.eclipse.org/OCL/Collection";
		addAnnotation(getPattern_AlsoKnownAs(), source, new String[] { "nullFree", "false" });
		addAnnotation(getPattern_UsedTactics(), source, new String[] { "nullFree", "false" });
	}

	/**
	 * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot</b>.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void createPivotAnnotations() {
		String source = "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot";
		addAnnotation(patternComponentEClass, source, new String[] { "contentIsPatternContent",
				"content->forAll(c | c.oclIsTypeOf(PatternComponent) or c.oclIsTypeOf(PatternPort) or c.oclIsTypeOf(PatternLink))" });
		addAnnotation(patternLinkEClass, source, new String[] { "srcIsPatternPort", "src.oclIsTypeOf(PatternLink)",
				"dstIsPatternPort", "dst.oclIsTypeOf(PatternLink)" });
		addAnnotation(multiplicityElementEClass, source, new String[] { "cardinalityAsElementOrMult",
				"(not (cardinalityElement.oclIsUndefined())) implies multiplicityValue = 1" });
	}

} //PseimPackageImpl
