Class JabaModel
java.lang.Object
jaba.JabaModel
- All Implemented Interfaces:
JabaConstants
An object grouping all the data describing a system.
WARNING: ACCESS TO THIS OBJECT MUST BE IMPLEMENTED IN A TRANSACTION-LIKE SYNCHRONIZED WAY!
WARNING: ACCESS TO THIS OBJECT MUST BE IMPLEMENTED IN A TRANSACTION-LIKE SYNCHRONIZED WAY!
- Author:
- alyf (Andrea Conti), Stefano Omini, Bertoli Marco
-
Field Summary
Fields inherited from interface JabaConstants
CLASS_CLOSED, CLASS_OPEN, CLASS_TYPENAMES, CONVEX_HULL_VERTEX_EXPLANATION, DESCRIPITION_CONVEX_2D_GRAPH, DESCRIPITION_GRAPH, DESCRIPITION_GRAPH_PERFORMANCE_INDEX, DESCRIPTION_CLASSES, DESCRIPTION_COMMENT, DESCRIPTION_EMPTY, DESCRIPTION_QUEUELENGTHS, DESCRIPTION_RESPONSETIMES, DESCRIPTION_SERVICEDEMANDS, DESCRIPTION_SERVICETIMES, DESCRIPTION_STATIONS, DESCRIPTION_THROUGHPUTS, DESCRIPTION_UTILIZATIONS, DESCRIPTION_VISITS, MAX_CLASSES, MAX_STATIONS, OPTION_SHOW_ONLY_BOTTLENECK, SELECT_WHICH_INDEX, SERVICE_DEMANDS_PROP, STATION_DELAY, STATION_LD, STATION_LI, STATION_TYPENAMES, STATION_TYPENAMES_LD_ENABLED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanThis method tells if visits were set or are all unitary (or zero if corresponding service time is zero).Creates a DOM representation of this objectdouble[][]voiddeleteClass(int i) Deletes a classvoiddeleteStation(int i) Deletes a stationvoidClears all the resultsdouble[]intString[]int[]Gets the model descriptiondoubleReturns global aggregate for queue lengthdoubleReturns system response timedoubleReturns global aggregate for utilizationdoubleReturns global aggregate for throughputdouble[]Returns per-class aggregate for queue lengthdouble[]Returns per-class aggregate for residence timesdouble[]Returns per-class aggregate for utilizationdouble[]Returns per-class aggregate for throughputdouble[]Returns per-station aggregate for queue lengthdouble[]Returns per-station aggregate for residence timesdouble[]Returns per-station aggregate for utilizationdouble[]Returns per-station aggregate for throughputdouble[][]double[][]double[][][]String[]intint[]double[][]intdouble[][]double[][]booleanbooleanbooleanisClosed()booleanisLd()booleanisMixed()booleanbooleanisOpen()booleanbooleanloadClasses(Node classNode) booleanloadDescription(Element desc) booleanloadDocument(Document doc) load the state of this object from the Document.double[][]loadResultsMatrix(Element base, int len1, int len2, String res) booleanloadSolution(Element sol) booleanloadStations(Node stationNode) voidRandomizes model's service times and visits.voidremoveLD()Removes all LD stations, converting them into LI stationsvoidresets the changed flag.voidresize(int stations, int classes) Resizes the data structures according to specified parameters.voidflags the model as changed.voidsetClassData(double[] classData) sets the data for the classesvoidsetClassNames(String[] classNames) sets the names of the classes.voidsetClassTypes(int[] classTypes) sets the type of the classesvoidInitialize the object with defaults: 1 closed class, 1 LI station, 0 customers, all visits to one, all service times to zero, no resultsvoidsetDescription(String description) Sets the model descriptionvoidsetResults(JabaResults jabaResults) sets all the result data for this model.voidsetServiceTimes(double[][][] serviceTimes) sets the matrix of service timesvoidsetStationNames(String[] stationNames) sets the names of the service centers.voidsetStationTypes(int[] stationTypes) sets the type of the stationsvoidsetVisits(double[][] visits) sets the matrix of visitstoString()Warning: Calling this on large systems *will* result in OutOfMemory errors.
-
Constructor Details
-
JabaModel
public JabaModel()make an object with default values -
JabaModel
copy constructor
-
-
Method Details
-
discardResults
public void discardResults()Clears all the results -
setResults
sets all the result data for this model. -
getResults
-
setDefaults
public void setDefaults()Initialize the object with defaults: 1 closed class, 1 LI station, 0 customers, all visits to one, all service times to zero, no results -
getDescription
-
setDescription
Sets the model description- Parameters:
description- the model description
-
isSingleClass
public boolean isSingleClass()- Returns:
- true if this object describes a single class system
-
isMultiClass
public boolean isMultiClass()- Returns:
- true if this object describes a multiclass system
-
isClosed
public boolean isClosed()- Returns:
- true if this object describes a closed system
-
isOpen
public boolean isOpen()- Returns:
- true if this object describes an open system
-
isMixed
public boolean isMixed()- Returns:
- true if this object describes a mixed system
-
isLd
public boolean isLd()- Returns:
- true if this object describes a system containing LD stations
-
getStations
public int getStations()- Returns:
- number of service centers
-
getClasses
public int getClasses()- Returns:
- number of classes
-
getTotalPop
public int getTotalPop()- Returns:
- total population
-
getStationNames
- Returns:
- names of the service centers
-
setStationNames
sets the names of the service centers.- Parameters:
stationNames- the names of the service centers- Throws:
IllegalArgumentException- if the array is not of the correct size
-
getClassNames
- Returns:
- names of the classes
-
setClassNames
sets the names of the classes.- Parameters:
classNames- the names of the classes- Throws:
IllegalArgumentException- if the array is not of the correct size
-
getClassData
public double[] getClassData()- Returns:
- data for the classes.
-
setClassData
public void setClassData(double[] classData) sets the data for the classes- Parameters:
classData- the data for the classes- Throws:
IllegalArgumentException- if the array is not of the correct size
-
getClassTypes
public int[] getClassTypes()- Returns:
- type of the classes
-
setClassTypes
public void setClassTypes(int[] classTypes) sets the type of the classes- Parameters:
classTypes- the type of the classes- Throws:
IllegalArgumentException- if the array is not of the correct size
-
getStationTypes
public int[] getStationTypes()- Returns:
- type of the stations
-
setStationTypes
public void setStationTypes(int[] stationTypes) sets the type of the stations- Parameters:
stationTypes- the type of the stations- Throws:
IllegalArgumentException- if the array is not of the correct size
-
getVisits
public double[][] getVisits()- Returns:
- the matrix of visits
-
areVisitsSet
public boolean areVisitsSet()This method tells if visits were set or are all unitary (or zero if corresponding service time is zero). This is used to show correct panel layout upon loading- Returns:
- true iff visits were not set
-
setVisits
public void setVisits(double[][] visits) sets the matrix of visits- Parameters:
visits- the matrix of visits- Throws:
IllegalArgumentException- if the matrix is not of the correct size
-
getServiceTimes
public double[][][] getServiceTimes()- Returns:
- the matrix of service times
-
setServiceTimes
public void setServiceTimes(double[][][] serviceTimes) sets the matrix of service times- Parameters:
serviceTimes- the matrix of service times- Throws:
IllegalArgumentException- if the matrix is not of the correct size
-
resize
public void resize(int stations, int classes) Resizes the data structures according to specified parameters. Data is preserved as far as possible -
getQueueLen
public double[][] getQueueLen()- Returns:
- queue lengths
-
getResTimes
public double[][] getResTimes()- Returns:
- response times
-
getThroughput
public double[][] getThroughput()- Returns:
- throughputs
-
getUtilization
public double[][] getUtilization()- Returns:
- utilizations
-
removeLD
public void removeLD()Removes all LD stations, converting them into LI stations -
toString
-
deleteClass
public void deleteClass(int i) Deletes a class- Parameters:
i- the index of the class
-
deleteStation
public void deleteStation(int i) Deletes a station- Parameters:
i- the index of the station
-
isChanged
public boolean isChanged()- Returns:
- true if the model has been changed
-
resetChanged
public void resetChanged()resets the changed flag.
WARNING: this enables change checking on parameter setting, which can be quite time-consuming. -
setChanged
public void setChanged()flags the model as changed. There is no need to call this, except to disable time-consuming change checking if you're not interested in it -
hasResults
public boolean hasResults()- Returns:
- true if results are available
-
areResultsOK
public boolean areResultsOK()- Returns:
- true if results are valid
-
createDocument
Creates a DOM representation of this object- Returns:
- a DOM representation of this object
-
loadDocument
load the state of this object from the Document.- Returns:
- true if the operation was successful. WARNING: If the operation fails the object is left in an incorrect state and should be discarded.
-
loadDescription
-
loadClasses
-
loadStations
-
loadSolution
-
loadResultsMatrix
-
getPerClassX
public double[] getPerClassX()Returns per-class aggregate for throughput -
getPerStationX
public double[] getPerStationX()Returns per-station aggregate for throughput -
getGlobalX
public double getGlobalX()Returns global aggregate for throughput -
getPerClassQ
public double[] getPerClassQ()Returns per-class aggregate for queue length -
getPerStationQ
public double[] getPerStationQ()Returns per-station aggregate for queue length -
getGlobalQ
public double getGlobalQ()Returns global aggregate for queue length -
getPerClassR
public double[] getPerClassR()Returns per-class aggregate for residence times -
getPerStationR
public double[] getPerStationR()Returns per-station aggregate for residence times -
getGlobalR
public double getGlobalR()Returns system response time -
getPerClassU
public double[] getPerClassU()Returns per-class aggregate for utilization -
getPerStationU
public double[] getPerStationU()Returns per-station aggregate for utilization -
getGlobalU
public double getGlobalU()Returns global aggregate for utilization -
randomizeModelData
public void randomizeModelData()Randomizes model's service times and visits.
Modified by Bertoli Marco to limit service times to two decimal -
createUnitaryVisits
public double[][] createUnitaryVisits() -
getVertices3D
-
getHullVertices
-