File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ public class Uniform : Distribution<double> {
366
366
public double Lower => _lower ;
367
367
public double Upper => _upper ;
368
368
369
- public double Mean => 0.5 * ( _upper - _lower ) ;
369
+ public double Mean => 0.5 * ( _lower + _upper ) ;
370
370
public double StdDev => Math . Sqrt ( ( _upper - _lower ) * ( _upper - _lower ) / 12.0 ) ;
371
371
372
372
public Uniform ( double lower , double upperExclusive ) {
@@ -390,7 +390,7 @@ public class UniformTime : Distribution<TimeSpan> {
390
390
391
391
public TimeSpan Lower => _lower ;
392
392
public TimeSpan Upper => _upper ;
393
- public TimeSpan MeanTime => TimeSpan . FromSeconds ( 0.5 * ( _upper - _lower ) . TotalSeconds ) ;
393
+ public TimeSpan MeanTime => TimeSpan . FromSeconds ( 0.5 * ( _lower + _upper ) . TotalSeconds ) ;
394
394
public TimeSpan StdDevTime => TimeSpan . FromSeconds ( Math . Sqrt ( ( _upper - _lower ) . TotalSeconds * ( _upper - _lower ) . TotalSeconds / 12.0 ) ) ;
395
395
396
396
public UniformTime ( TimeSpan lower , TimeSpan upperExclusive ) {
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
3
3
<PropertyGroup >
4
- <TargetFrameworks >netstandard2.0;net45 </TargetFrameworks >
4
+ <TargetFrameworks >netstandard2.0;net462 </TargetFrameworks >
5
5
<SignAssembly >True</SignAssembly >
6
6
<AssemblyOriginatorKeyFile >SimSharp.snk</AssemblyOriginatorKeyFile >
7
7
<DelaySign >False</DelaySign >
@@ -33,7 +33,7 @@ Sim# allows modeling processes easily and with little boiler plate code. A proce
33
33
1) All of the RandXXX methods in class Simulation have been marked as obsolete.
34
34
2) All of the random TimeoutXXX methods in class Simulation have been marked as obsolete.
35
35
36
- To port code, it is advised to add " using static SimSharp.Distributions" to the using section and change e.g.
36
+ To port code, it is advised to add " using static SimSharp.Distributions" to the using section and change e.g.
37
37
env.RandUniform(1, 2) to env.Rand(UNIF(1, 2))
38
38
env.RandNormalPositive(3, 0.5) to env.Rand(POS(N(3, 0.5)))
39
39
env.RandLogNormal(1, 2) to env.Rand(LNORM(1, 2))
You can’t perform that action at this time.
0 commit comments