| /** |
| * Copyright (c) 2020 CEA LIST |
| * |
| * 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/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| */ |
| package org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_initializers.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_initializers.Layer_weight_initializersPackage; |
| import org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_initializers.random_uniform; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>random uniform</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_initializers.impl.random_uniformImpl#getMinval <em>Minval</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_initializers.impl.random_uniformImpl#getMaxval <em>Maxval</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class random_uniformImpl extends initializer_with_seedImpl implements random_uniform { |
| /** |
| * The default value of the '{@link #getMinval() <em>Minval</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMinval() |
| * @generated |
| * @ordered |
| */ |
| protected static final double MINVAL_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getMinval() <em>Minval</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMinval() |
| * @generated |
| * @ordered |
| */ |
| protected double minval = MINVAL_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getMaxval() <em>Maxval</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMaxval() |
| * @generated |
| * @ordered |
| */ |
| protected static final double MAXVAL_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getMaxval() <em>Maxval</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMaxval() |
| * @generated |
| * @ordered |
| */ |
| protected double maxval = MAXVAL_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected random_uniformImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return Layer_weight_initializersPackage.Literals.RANDOM_UNIFORM; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public double getMinval() { |
| return minval; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setMinval(double newMinval) { |
| double oldMinval = minval; |
| minval = newMinval; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Layer_weight_initializersPackage.RANDOM_UNIFORM__MINVAL, oldMinval, minval)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public double getMaxval() { |
| return maxval; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setMaxval(double newMaxval) { |
| double oldMaxval = maxval; |
| maxval = newMaxval; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Layer_weight_initializersPackage.RANDOM_UNIFORM__MAXVAL, oldMaxval, maxval)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case Layer_weight_initializersPackage.RANDOM_UNIFORM__MINVAL: |
| return getMinval(); |
| case Layer_weight_initializersPackage.RANDOM_UNIFORM__MAXVAL: |
| return getMaxval(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case Layer_weight_initializersPackage.RANDOM_UNIFORM__MINVAL: |
| setMinval((Double)newValue); |
| return; |
| case Layer_weight_initializersPackage.RANDOM_UNIFORM__MAXVAL: |
| setMaxval((Double)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case Layer_weight_initializersPackage.RANDOM_UNIFORM__MINVAL: |
| setMinval(MINVAL_EDEFAULT); |
| return; |
| case Layer_weight_initializersPackage.RANDOM_UNIFORM__MAXVAL: |
| setMaxval(MAXVAL_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case Layer_weight_initializersPackage.RANDOM_UNIFORM__MINVAL: |
| return minval != MINVAL_EDEFAULT; |
| case Layer_weight_initializersPackage.RANDOM_UNIFORM__MAXVAL: |
| return maxval != MAXVAL_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (minval: "); //$NON-NLS-1$ |
| result.append(minval); |
| result.append(", maxval: "); //$NON-NLS-1$ |
| result.append(maxval); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //random_uniformImpl |