@ -48,7 +48,7 @@ public class ChoiceListFlexi //implements Choice
/ / Probabilities / rates are already evaluated , target states are not
/ / Probabilities / rates are already evaluated , target states are not
/ / but are just stored as lists of updates ( for efficiency )
/ / but are just stored as lists of updates ( for efficiency )
protected List < List < Update > > updates ;
protected List < List < Update > > updates ;
protected List < Express ion> probability ;
protected List < Funct ion> probability ;
/ * *
/ * *
* Create empty choice .
* Create empty choice .
@ -56,7 +56,7 @@ public class ChoiceListFlexi //implements Choice
public ChoiceListFlexi ( )
public ChoiceListFlexi ( )
{
{
updates = new ArrayList < List < Update > > ( ) ;
updates = new ArrayList < List < Update > > ( ) ;
probability = new ArrayList < Express ion> ( ) ;
probability = new ArrayList < Funct ion> ( ) ;
}
}
/ * *
/ * *
@ -74,8 +74,8 @@ public class ChoiceListFlexi //implements Choice
listNew . add ( up ) ;
listNew . add ( up ) ;
}
}
}
}
probability = new ArrayList < Express ion> ( ch . size ( ) ) ;
for ( Express ion p : ch . probability ) {
probability = new ArrayList < Funct ion> ( ch . size ( ) ) ;
for ( Funct ion p : ch . probability ) {
probability . add ( p ) ;
probability . add ( p ) ;
}
}
}
}
@ -97,7 +97,7 @@ public class ChoiceListFlexi //implements Choice
* @param probability Probability ( or rate ) of the transition
* @param probability Probability ( or rate ) of the transition
* @param ups List of Update objects defining transition
* @param ups List of Update objects defining transition
* /
* /
public void add ( Express ion probability , List < Update > ups )
public void add ( Funct ion probability , List < Update > ups )
{
{
this . updates . add ( ups ) ;
this . updates . add ( ups ) ;
this . probability . add ( probability ) ;
this . probability . add ( probability ) ;
@ -122,7 +122,7 @@ public class ChoiceListFlexi //implements Choice
{
{
List < Update > list ;
List < Update > list ;
int i , j , n , n2 ;
int i , j , n , n2 ;
Express ion pi ;
Funct ion pi ;
n = ch . size ( ) ;
n = ch . size ( ) ;
n2 = size ( ) ;
n2 = size ( ) ;
@ -139,7 +139,7 @@ public class ChoiceListFlexi //implements Choice
for ( Update u : ch . updates . get ( i ) ) {
for ( Update u : ch . updates . get ( i ) ) {
list . add ( u ) ;
list . add ( u ) ;
}
}
add ( ( Expression ) Expression . Times ( pi , getProbability ( j ) ) . simplify ( ) , list ) ;
add ( pi . multiply ( getProbability ( j ) ) , list ) ;
}
}
}
}
/ / Modify elements of current choice to get ( 0 , j ) elements of product
/ / Modify elements of current choice to get ( 0 , j ) elements of product
@ -148,7 +148,7 @@ public class ChoiceListFlexi //implements Choice
for ( Update u : ch . updates . get ( 0 ) ) {
for ( Update u : ch . updates . get ( 0 ) ) {
updates . get ( j ) . add ( u ) ;
updates . get ( j ) . add ( u ) ;
}
}
probability . set ( j , ( Expression ) Expression . Times ( pi , getProbability ( j ) ) . simplify ( ) ) ;
probability . set ( j , pi . multiply ( getProbability ( j ) ) ) ;
}
}
}
}
@ -223,7 +223,7 @@ public class ChoiceListFlexi //implements Choice
up . update ( currentState , newState ) ;
up . update ( currentState , newState ) ;
}
}
public Express ion getProbability ( int i )
public Funct ion getProbability ( int i )
{
{
return probability . get ( i ) ;
return probability . get ( i ) ;
}
}