Commit 37bb21be authored by Simon Eismann's avatar Simon Eismann

added DeterministicConcurrency distribution

parent 9301602b
......@@ -877,6 +877,8 @@
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="valuesFile" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="probabilitiesFile" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="concurrenciesFile" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="responsetimesFile" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="QueueingPetriNet">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
......
......@@ -202,6 +202,8 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute qpme.ecore#//QueueingColorReference/replayFile"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute qpme.ecore#//QueueingColorReference/valuesFile"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute qpme.ecore#//QueueingColorReference/probabilitiesFile"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute qpme.ecore#//QueueingColorReference/concurrenciesFile"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute qpme.ecore#//QueueingColorReference/responsetimesFile"/>
</genClasses>
<genClasses ecoreClass="qpme.ecore#//QueueingPetriNet">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference qpme.ecore#//QueueingPetriNet/colors"/>
......
......@@ -1978,6 +1978,24 @@ public interface ModelPackage extends EPackage {
*/
int QUEUEING_COLOR_REFERENCE__PROBABILITIES_FILE = PLACE_COLOR_REFERENCE_FEATURE_COUNT + 21;
/**
* The feature id for the '<em><b>Concurrencies File</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int QUEUEING_COLOR_REFERENCE__CONCURRENCIES_FILE = PLACE_COLOR_REFERENCE_FEATURE_COUNT + 22;
/**
* The feature id for the '<em><b>Responsetimes File</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int QUEUEING_COLOR_REFERENCE__RESPONSETIMES_FILE = PLACE_COLOR_REFERENCE_FEATURE_COUNT + 23;
/**
* The number of structural features of the '<em>Queueing Color Reference</em>' class.
* <!-- begin-user-doc -->
......@@ -1985,7 +2003,7 @@ public interface ModelPackage extends EPackage {
* @generated
* @ordered
*/
int QUEUEING_COLOR_REFERENCE_FEATURE_COUNT = PLACE_COLOR_REFERENCE_FEATURE_COUNT + 22;
int QUEUEING_COLOR_REFERENCE_FEATURE_COUNT = PLACE_COLOR_REFERENCE_FEATURE_COUNT + 24;
/**
* The meta object id for the '{@link edu.kit.ipd.descartes.qpme.model.impl.QueueingPetriNetImpl <em>Queueing Petri Net</em>}' class.
......@@ -4692,6 +4710,28 @@ public interface ModelPackage extends EPackage {
*/
EAttribute getQueueingColorReference_ProbabilitiesFile();
/**
* Returns the meta object for the attribute '{@link edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getConcurrenciesFile <em>Concurrencies File</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Concurrencies File</em>'.
* @see edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getConcurrenciesFile()
* @see #getQueueingColorReference()
* @generated
*/
EAttribute getQueueingColorReference_ConcurrenciesFile();
/**
* Returns the meta object for the attribute '{@link edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getResponsetimesFile <em>Responsetimes File</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Responsetimes File</em>'.
* @see edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getResponsetimesFile()
* @see #getQueueingColorReference()
* @generated
*/
EAttribute getQueueingColorReference_ResponsetimesFile();
/**
* Returns the meta object for class '{@link edu.kit.ipd.descartes.qpme.model.QueueingPetriNet <em>Queueing Petri Net</em>}'.
* <!-- begin-user-doc -->
......@@ -6677,6 +6717,22 @@ public interface ModelPackage extends EPackage {
*/
EAttribute QUEUEING_COLOR_REFERENCE__PROBABILITIES_FILE = eINSTANCE.getQueueingColorReference_ProbabilitiesFile();
/**
* The meta object literal for the '<em><b>Concurrencies File</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute QUEUEING_COLOR_REFERENCE__CONCURRENCIES_FILE = eINSTANCE.getQueueingColorReference_ConcurrenciesFile();
/**
* The meta object literal for the '<em><b>Responsetimes File</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute QUEUEING_COLOR_REFERENCE__RESPONSETIMES_FILE = eINSTANCE.getQueueingColorReference_ResponsetimesFile();
/**
* The meta object literal for the '{@link edu.kit.ipd.descartes.qpme.model.impl.QueueingPetriNetImpl <em>Queueing Petri Net</em>}' class.
* <!-- begin-user-doc -->
......
......@@ -60,7 +60,7 @@ public interface QpmeDocument extends EObject {
* <!-- end-user-doc -->
* @return the value of the '<em>XMLNS Prefix Map</em>' map.
* @see edu.kit.ipd.descartes.qpme.model.ModelPackage#getQpmeDocument_XMLNSPrefixMap()
* @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true"
* @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry&lt;org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString&gt;" transient="true"
* extendedMetaData="kind='attribute' name='xmlns:prefix'"
* @generated
*/
......@@ -78,7 +78,7 @@ public interface QpmeDocument extends EObject {
* <!-- end-user-doc -->
* @return the value of the '<em>XSI Schema Location</em>' map.
* @see edu.kit.ipd.descartes.qpme.model.ModelPackage#getQpmeDocument_XSISchemaLocation()
* @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true"
* @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry&lt;org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString&gt;" transient="true"
* extendedMetaData="kind='attribute' name='xsi:schemaLocation'"
* @generated
*/
......
......@@ -38,6 +38,8 @@ package edu.kit.ipd.descartes.qpme.model;
* <li>{@link edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getReplayFile <em>Replay File</em>}</li>
* <li>{@link edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getValuesFile <em>Values File</em>}</li>
* <li>{@link edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getProbabilitiesFile <em>Probabilities File</em>}</li>
* <li>{@link edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getConcurrenciesFile <em>Concurrencies File</em>}</li>
* <li>{@link edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getResponsetimesFile <em>Responsetimes File</em>}</li>
* </ul>
*
* @see edu.kit.ipd.descartes.qpme.model.ModelPackage#getQueueingColorReference()
......@@ -1126,4 +1128,56 @@ public interface QueueingColorReference extends PlaceColorReference {
*/
void setProbabilitiesFile(String value);
/**
* Returns the value of the '<em><b>Concurrencies File</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Concurrencies File</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Concurrencies File</em>' attribute.
* @see #setConcurrenciesFile(String)
* @see edu.kit.ipd.descartes.qpme.model.ModelPackage#getQueueingColorReference_ConcurrenciesFile()
* @model
* @generated
*/
String getConcurrenciesFile();
/**
* Sets the value of the '{@link edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getConcurrenciesFile <em>Concurrencies File</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Concurrencies File</em>' attribute.
* @see #getConcurrenciesFile()
* @generated
*/
void setConcurrenciesFile(String value);
/**
* Returns the value of the '<em><b>Responsetimes File</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Responsetimes File</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Responsetimes File</em>' attribute.
* @see #setResponsetimesFile(String)
* @see edu.kit.ipd.descartes.qpme.model.ModelPackage#getQueueingColorReference_ResponsetimesFile()
* @model
* @generated
*/
String getResponsetimesFile();
/**
* Sets the value of the '{@link edu.kit.ipd.descartes.qpme.model.QueueingColorReference#getResponsetimesFile <em>Responsetimes File</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Responsetimes File</em>' attribute.
* @see #getResponsetimesFile()
* @generated
*/
void setResponsetimesFile(String value);
} // QueueingColorReference
......@@ -1623,6 +1623,24 @@ public class ModelPackageImpl extends EPackageImpl implements ModelPackage {
return (EAttribute)queueingColorReferenceEClass.getEStructuralFeatures().get(21);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getQueueingColorReference_ConcurrenciesFile() {
return (EAttribute)queueingColorReferenceEClass.getEStructuralFeatures().get(22);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getQueueingColorReference_ResponsetimesFile() {
return (EAttribute)queueingColorReferenceEClass.getEStructuralFeatures().get(23);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -2640,6 +2658,8 @@ public class ModelPackageImpl extends EPackageImpl implements ModelPackage {
createEAttribute(queueingColorReferenceEClass, QUEUEING_COLOR_REFERENCE__REPLAY_FILE);
createEAttribute(queueingColorReferenceEClass, QUEUEING_COLOR_REFERENCE__VALUES_FILE);
createEAttribute(queueingColorReferenceEClass, QUEUEING_COLOR_REFERENCE__PROBABILITIES_FILE);
createEAttribute(queueingColorReferenceEClass, QUEUEING_COLOR_REFERENCE__CONCURRENCIES_FILE);
createEAttribute(queueingColorReferenceEClass, QUEUEING_COLOR_REFERENCE__RESPONSETIMES_FILE);
queueingPetriNetEClass = createEClass(QUEUEING_PETRI_NET);
createEReference(queueingPetriNetEClass, QUEUEING_PETRI_NET__COLORS);
......@@ -2974,6 +2994,8 @@ public class ModelPackageImpl extends EPackageImpl implements ModelPackage {
initEAttribute(getQueueingColorReference_ReplayFile(), theXMLTypePackage.getString(), "replayFile", null, 0, 1, QueueingColorReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getQueueingColorReference_ValuesFile(), theXMLTypePackage.getString(), "valuesFile", null, 0, 1, QueueingColorReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getQueueingColorReference_ProbabilitiesFile(), theXMLTypePackage.getString(), "probabilitiesFile", null, 0, 1, QueueingColorReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getQueueingColorReference_ConcurrenciesFile(), ecorePackage.getEString(), "concurrenciesFile", null, 0, 1, QueueingColorReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getQueueingColorReference_ResponsetimesFile(), ecorePackage.getEString(), "responsetimesFile", null, 0, 1, QueueingColorReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(queueingPetriNetEClass, QueueingPetriNet.class, "QueueingPetriNet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getQueueingPetriNet_Colors(), this.getColorsContainer(), null, "colors", null, 0, 1, QueueingPetriNet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
......
......@@ -44,6 +44,8 @@ import edu.kit.ipd.descartes.qpme.model.QueueingColorReference;
* <li>{@link edu.kit.ipd.descartes.qpme.model.impl.QueueingColorReferenceImpl#getReplayFile <em>Replay File</em>}</li>
* <li>{@link edu.kit.ipd.descartes.qpme.model.impl.QueueingColorReferenceImpl#getValuesFile <em>Values File</em>}</li>
* <li>{@link edu.kit.ipd.descartes.qpme.model.impl.QueueingColorReferenceImpl#getProbabilitiesFile <em>Probabilities File</em>}</li>
* <li>{@link edu.kit.ipd.descartes.qpme.model.impl.QueueingColorReferenceImpl#getConcurrenciesFile <em>Concurrencies File</em>}</li>
* <li>{@link edu.kit.ipd.descartes.qpme.model.impl.QueueingColorReferenceImpl#getResponsetimesFile <em>Responsetimes File</em>}</li>
* </ul>
*
* @generated
......@@ -651,6 +653,46 @@ public class QueueingColorReferenceImpl extends PlaceColorReferenceImpl implemen
*/
protected String probabilitiesFile = PROBABILITIES_FILE_EDEFAULT;
/**
* The default value of the '{@link #getConcurrenciesFile() <em>Concurrencies File</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getConcurrenciesFile()
* @generated
* @ordered
*/
protected static final String CONCURRENCIES_FILE_EDEFAULT = null;
/**
* The cached value of the '{@link #getConcurrenciesFile() <em>Concurrencies File</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getConcurrenciesFile()
* @generated
* @ordered
*/
protected String concurrenciesFile = CONCURRENCIES_FILE_EDEFAULT;
/**
* The default value of the '{@link #getResponsetimesFile() <em>Responsetimes File</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getResponsetimesFile()
* @generated
* @ordered
*/
protected static final String RESPONSETIMES_FILE_EDEFAULT = null;
/**
* The cached value of the '{@link #getResponsetimesFile() <em>Responsetimes File</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getResponsetimesFile()
* @generated
* @ordered
*/
protected String responsetimesFile = RESPONSETIMES_FILE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -1582,6 +1624,48 @@ public class QueueingColorReferenceImpl extends PlaceColorReferenceImpl implemen
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.QUEUEING_COLOR_REFERENCE__PROBABILITIES_FILE, oldProbabilitiesFile, probabilitiesFile));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getConcurrenciesFile() {
return concurrenciesFile;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setConcurrenciesFile(String newConcurrenciesFile) {
String oldConcurrenciesFile = concurrenciesFile;
concurrenciesFile = newConcurrenciesFile;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.QUEUEING_COLOR_REFERENCE__CONCURRENCIES_FILE, oldConcurrenciesFile, concurrenciesFile));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getResponsetimesFile() {
return responsetimesFile;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setResponsetimesFile(String newResponsetimesFile) {
String oldResponsetimesFile = responsetimesFile;
responsetimesFile = newResponsetimesFile;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.QUEUEING_COLOR_REFERENCE__RESPONSETIMES_FILE, oldResponsetimesFile, responsetimesFile));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -1634,6 +1718,10 @@ public class QueueingColorReferenceImpl extends PlaceColorReferenceImpl implemen
return getValuesFile();
case ModelPackage.QUEUEING_COLOR_REFERENCE__PROBABILITIES_FILE:
return getProbabilitiesFile();
case ModelPackage.QUEUEING_COLOR_REFERENCE__CONCURRENCIES_FILE:
return getConcurrenciesFile();
case ModelPackage.QUEUEING_COLOR_REFERENCE__RESPONSETIMES_FILE:
return getResponsetimesFile();
}
return super.eGet(featureID, resolve, coreType);
}
......@@ -1712,6 +1800,12 @@ public class QueueingColorReferenceImpl extends PlaceColorReferenceImpl implemen
case ModelPackage.QUEUEING_COLOR_REFERENCE__PROBABILITIES_FILE:
setProbabilitiesFile((String)newValue);
return;
case ModelPackage.QUEUEING_COLOR_REFERENCE__CONCURRENCIES_FILE:
setConcurrenciesFile((String)newValue);
return;
case ModelPackage.QUEUEING_COLOR_REFERENCE__RESPONSETIMES_FILE:
setResponsetimesFile((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
......@@ -1790,6 +1884,12 @@ public class QueueingColorReferenceImpl extends PlaceColorReferenceImpl implemen
case ModelPackage.QUEUEING_COLOR_REFERENCE__PROBABILITIES_FILE:
setProbabilitiesFile(PROBABILITIES_FILE_EDEFAULT);
return;
case ModelPackage.QUEUEING_COLOR_REFERENCE__CONCURRENCIES_FILE:
setConcurrenciesFile(CONCURRENCIES_FILE_EDEFAULT);
return;
case ModelPackage.QUEUEING_COLOR_REFERENCE__RESPONSETIMES_FILE:
setResponsetimesFile(RESPONSETIMES_FILE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
......@@ -1846,6 +1946,10 @@ public class QueueingColorReferenceImpl extends PlaceColorReferenceImpl implemen
return VALUES_FILE_EDEFAULT == null ? valuesFile != null : !VALUES_FILE_EDEFAULT.equals(valuesFile);
case ModelPackage.QUEUEING_COLOR_REFERENCE__PROBABILITIES_FILE:
return PROBABILITIES_FILE_EDEFAULT == null ? probabilitiesFile != null : !PROBABILITIES_FILE_EDEFAULT.equals(probabilitiesFile);
case ModelPackage.QUEUEING_COLOR_REFERENCE__CONCURRENCIES_FILE:
return CONCURRENCIES_FILE_EDEFAULT == null ? concurrenciesFile != null : !CONCURRENCIES_FILE_EDEFAULT.equals(concurrenciesFile);
case ModelPackage.QUEUEING_COLOR_REFERENCE__RESPONSETIMES_FILE:
return RESPONSETIMES_FILE_EDEFAULT == null ? responsetimesFile != null : !RESPONSETIMES_FILE_EDEFAULT.equals(responsetimesFile);
}
return super.eIsSet(featureID);
}
......@@ -1904,6 +2008,10 @@ public class QueueingColorReferenceImpl extends PlaceColorReferenceImpl implemen
result.append(valuesFile);
result.append(", probabilitiesFile: ");
result.append(probabilitiesFile);
result.append(", concurrenciesFile: ");
result.append(concurrenciesFile);
result.append(", responsetimesFile: ");
result.append(responsetimesFile);
result.append(')');
return result.toString();
}
......
/* ==============================================
* QPME : Queueing Petri net Modeling Environment
* ==============================================
*
* (c) Copyright 2003-2011, by Samuel Kounev and Contributors.
*
* Project Info: http://descartes.ipd.kit.edu/projects/qpme/
* http://www.descartes-research.net/
*
* All rights reserved. This software is made available under the terms of the
* Eclipse Public License (EPL) v1.0 as published by the Eclipse Foundation
* http://www.eclipse.org/legal/epl-v10.html
*
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse Public License (EPL)
* for more details.
*
* You should have received a copy of the Eclipse Public License (EPL)
* along with this software; if not visit http://www.eclipse.org or write to
* Eclipse Foundation, Inc., 308 SW First Avenue, Suite 110, Portland, 97204 USA
* Email: license (at) eclipse.org
*
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
* in the United States and other countries.]
*
* =============================================
*
* Original Author(s): Fabian Brosig
* Contributor(s):
*
* NOTE: The above list of contributors lists only the people that have
* contributed to this source file - for a list of ALL contributors to
* the project, please see the README.txt file.
*
* History:
* Date ID Description
* ---------- ---------------- ------------------------------------------------------------------
* 2013 Fabian Brosig Created.
*/
package de.tud.cs.simqpn.kernel.loading.distributions;
import java.util.Map;
public class DeterministicConcurrency implements AbstractDistribution {
private Map<Integer, Double> concurrencyLevels;
private String colorRefId;
public DeterministicConcurrency(Map<Integer, Double> concurrencyLevels, String colorRefId) {
this.concurrencyLevels = concurrencyLevels;
this.colorRefId = colorRefId;
}
@Override
public double nextDouble(int concurrency) {
Double resp = concurrencyLevels.get(concurrency);
if (resp == null)
throw new IllegalStateException(
"No values for concurrency level " + concurrency + " in the files for the colorRef " + colorRefId);
return resp;
}
}
/* ==============================================
* QPME : Queueing Petri net Modeling Environment
* ==============================================
*
* (c) Copyright 2003-2011, by Samuel Kounev and Contributors.
*
* Project Info: http://descartes.ipd.kit.edu/projects/qpme/
* http://www.descartes-research.net/
*
* All rights reserved. This software is made available under the terms of the
* Eclipse Public License (EPL) v1.0 as published by the Eclipse Foundation
* http://www.eclipse.org/legal/epl-v10.html
*
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse Public License (EPL)
* for more details.
*
* You should have received a copy of the Eclipse Public License (EPL)
* along with this software; if not visit http://www.eclipse.org or write to
* Eclipse Foundation, Inc., 308 SW First Avenue, Suite 110, Portland, 97204 USA
* Email: license (at) eclipse.org
*
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
* in the United States and other countries.]
*
* =============================================
*
* Original Author(s): Jrgen Walter
* Contributor(s):
*
* NOTE: The above list of contributors lists only the people that have
* contributed to this source file - for a list of ALL contributors to
* the project, please see the README.txt file.
*
* History:
* Date ID Description
* ---------- ---------------- ------------------------------------------------------------------
* 2014/03/10 Jrgen Walter Extracted from NetLoader
*
*/
package de.tud.cs.simqpn.kernel.loading.distributions;
import java.util.HashMap;
import java.util.Map;
import de.tud.cs.simqpn.kernel.SimQPNException;
public class DeterministicConcurrencyCreator extends DistributionCreator {
double concurrencies[] = null;
String concurrenciesFilename = null;
double responseTimes[] = null;
String responseTimesFilename = null;
@Override
protected void loadParams() throws SimQPNException {
concurrencies = this.loadDoublesFromFile("concurrenciesFile");
concurrenciesFilename = this.loadStringParam("concurrenciesFile");
responseTimes = this.loadDoublesFromFile("responsetimesFile");
responseTimesFilename = this.loadStringParam("responsetimesFile");
}
@Override
public AbstractDistribution getDistribution()
throws SimQPNException {
String colorRefId = loadStringParam("id");
Map<Integer, Double> concurrencyLevel = new HashMap<Integer, Double>();
for (int i = 0; i < concurrencies.length; i++) {
concurrencyLevel.put((int) (concurrencies[i]), responseTimes[i]);
}
return new DeterministicConcurrency(concurrencyLevel, colorRefId);
}
@Override
public double getMean() {
throw new IllegalStateException("Cannot calculate mean for DeterministicConcurrency distribution");
}
@Override
public String getConstructionText() {
return "(" + concurrenciesFilename + "|" + responseTimesFilename + ")";
}
@Override
public String getMeanComputationText() {
throw new IllegalStateException("Cannot calculate mean for DeterministicConcurrency distribution");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment