private IntVar makeDuration ( ) throws SchedulerException { if ( start . isInstantiated ( ) && end . isInstantiated ( ) ) { int d = end . getValue ( ) - start . getValue ( ) ; return rp . makeDuration ( d , d , lblPrefix , "_duration" ) ; } else if ( start . isInstantiated ( ) ) { if ( start . isInstantiatedTo ( 0 ) ) { return end ; } return rp . getModel ( ) . intOffsetView ( end , - start . getValue ( ) ) ; } int inf = end . getLB ( ) - start . getUB ( ) ; if ( inf < 0 ) { inf = 0 ; } int sup = end . getUB ( ) - start . getLB ( ) ; return rp . makeDuration ( sup , inf , lblPrefix , "_duration" ) ; }
Make the duration variable depending on the others .