The problem is in your CustomOutput C1, C2, and C3 for UniformDistribution1:
{ C1 'this.Value < 0.2 # 20% expected #' }
{ C2 'this.Value < 0.5# 30% expected #' }
{ C3 'this.Value <= 1.0 # 50% expected #' }
{ Case 'this.C1? 1 : (this.C2? 2 : ( this.C3? 3 : 4)) ' }
Each time this.Value is evaluated, it returns a new random sample from the distribution! This means that C1, C2, and C3 are completely unrelated to each other, which invalidates the Case output. Note that the random distribution functions for all simulation software work this way -- it is not just a quirk of JaamSim.
The correct way to calculate the Case output is to save the random sample as a local variable, i.e.:
{ Case 'rand = this.Value; rand < 0.2 ? 1 : (rand < 0.5 ? 2 : 3)' }
Note that C3 is always 1 in your original calculation so this portion of the expression for Case can be ignored.
An easier way to make this random selection is to use the DiscreteDistribution object instead of the UniformDistribution. Set its ValueLIst input to 1 2 3 and its ProbabilityList input to 0.2 0.3 0.5.
Or, you can do everything in an expression using the 'discrete' function: discrete( { 0.2, 0.3. 0.5 }, { 1, 2, 3 } )
Harry