SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.latnetbuilder.weights.WeightsComparable< T extends Comparable< T > > Class Template Referenceabstract

Implements comparable Weights. More...

Inheritance diagram for umontreal.ssj.latnetbuilder.weights.WeightsComparable< T extends Comparable< T > >:
umontreal.ssj.latnetbuilder.weights.Weights< T >

Public Member Functions

 WeightsComparable (List< SingletonWeightComparable< T > > w)
 Constructs weights from a list of SingletonWeightsComparable.
 WeightsComparable ()
 Initializes an empty list of comparable weights.
ArrayList< SingletonWeightComparable< T > > getComparableWeights ()
 Returns the current comparable weights.
void add (SingletonWeightComparable< T > singletonWeight)
 Adds a new comparable weight to the list.
void sort ()
 Sorts the weights w.r.t.
void add (T index, double weight)
 Adds a new weight with index 'index' and weight 'weight' or overwrites it, if the index already exists in the list.
Public Member Functions inherited from umontreal.ssj.latnetbuilder.weights.Weights< T >
 Weights (List< SingletonWeight< T > > w)
 Constructs weights from a list of SingletonWeights.
 Weights ()
 Initializes an empty list of weights.
ArrayList< SingletonWeight< T > > getWeights ()
 Returns the current weights as a list.
void setDefaultWeight (double dWeight)
 Sets 'dWeight' as the current 'defaultWeight'.
double getDefaultWeight ()
 Returns the current 'defaultWeight'.
void add (SingletonWeight< T > singletonWeight)
 Adds a new weight.
String toString ()
 Basic formatted string-output.
abstract String toLatNetBuilder ()
 Provides a String that can be interpreted by the command line interface of LatNetBuilder.

Additional Inherited Members

Protected Attributes inherited from umontreal.ssj.latnetbuilder.weights.Weights< T >
double defaultWeight = 0.0
 Weight to be used for indices that were not explicitly set.

Detailed Description

Implements comparable Weights.

Author
florian
Parameters
<T>indicates the data type of the index of the weight (e.g Integer). Needs to be comparable.

Definition at line 16 of file WeightsComparable.java.

Constructor & Destructor Documentation

◆ WeightsComparable() [1/2]

umontreal.ssj.latnetbuilder.weights.WeightsComparable< T extends Comparable< T > >.WeightsComparable ( List< SingletonWeightComparable< T > > w)

Constructs weights from a list of SingletonWeightsComparable.

Parameters
wlist of weights with index type 'T'.

Definition at line 26 of file WeightsComparable.java.

◆ WeightsComparable() [2/2]

umontreal.ssj.latnetbuilder.weights.WeightsComparable< T extends Comparable< T > >.WeightsComparable ( )

Initializes an empty list of comparable weights.

Definition at line 33 of file WeightsComparable.java.

Member Function Documentation

◆ add() [1/2]

void umontreal.ssj.latnetbuilder.weights.WeightsComparable< T extends Comparable< T > >.add ( SingletonWeightComparable< T > singletonWeight)

Adds a new comparable weight to the list.

In case the weight for the respective index had already been set, it is overwritten.

Parameters
singletonWeightcomparable weight to be added.

Definition at line 54 of file WeightsComparable.java.

◆ add() [2/2]

void umontreal.ssj.latnetbuilder.weights.WeightsComparable< T extends Comparable< T > >.add ( T index,
double weight )

Adds a new weight with index 'index' and weight 'weight' or overwrites it, if the index already exists in the list.

Parameters
indexindex of the weight to be added.
weightvalue of the weight to be added.

Reimplemented from umontreal.ssj.latnetbuilder.weights.Weights< T >.

Definition at line 83 of file WeightsComparable.java.

◆ getComparableWeights()

ArrayList< SingletonWeightComparable< T > > umontreal.ssj.latnetbuilder.weights.WeightsComparable< T extends Comparable< T > >.getComparableWeights ( )

Returns the current comparable weights.

Returns
the list of comparable weights.

Definition at line 44 of file WeightsComparable.java.

◆ sort()

void umontreal.ssj.latnetbuilder.weights.WeightsComparable< T extends Comparable< T > >.sort ( )

Sorts the weights w.r.t.

the ordering defined on 'T', i.e., on the indices.

Definition at line 71 of file WeightsComparable.java.


The documentation for this class was generated from the following file: