Пример #1
0
 public TxCalculateCostStrategy()
 {
     CalculateAlgorithm = new CalculateAlgorithm().Add(1000000, new LinerCalculateWay
     {
         Numerator     = 1,
         Denominator   = 16 * 50,
         ConstantValue = 10000
     }).Add(int.MaxValue, new PowerCalculateWay
     {
         Power          = 2,
         ChangeSpanBase = 100,
         Weight         = 1,
         WeightBase     = 1,
         Numerator      = 1,
         Denominator    = 16 * 50,
         Precision      = 100000000L
     }).Prepare();
 }
Пример #2
0
 public RamCalculateCostStrategy()
 {
     CalculateAlgorithm = new CalculateAlgorithm().Add(10, new LinerCalculateWay
     {
         Numerator     = 1,
         Denominator   = 8,
         ConstantValue = 10000
     }).Add(100, new LinerCalculateWay
     {
         Numerator   = 1,
         Denominator = 4
     }).Add(int.MaxValue, new PowerCalculateWay
     {
         Power          = 2,
         ChangeSpanBase = 2,
         Weight         = 250,
         Numerator      = 1,
         Denominator    = 4,
         WeightBase     = 40,
     }).Prepare();
 }
Пример #3
0
 public CpuCalculateCostStrategy()
 {
     CalculateAlgorithm = new CalculateAlgorithm().Add(10, new LinerCalculateWay
     {
         Numerator     = 1,
         Denominator   = 8,
         ConstantValue = 10000
     }).Add(100, new LinerCalculateWay
     {
         Numerator   = 1,
         Denominator = 4
     }).Add(int.MaxValue, new PowerCalculateWay
     {
         Power          = 2,
         ChangeSpanBase = 4,   // scale  x axis
         Weight         = 250, // unit weight,  means  (10 cpu count = 333 weight)
         WeightBase     = 40,
         Numerator      = 1,
         Denominator    = 4,
         Precision      = 100000000L // 1 token = 100000000
     }).Prepare();
 }