|
@@ -4,8 +4,6 @@ namespace refill;
|
|
|
|
|
|
class ctl_itemex
|
|
|
{
|
|
|
- const feed_threshold = 2;
|
|
|
-
|
|
|
private $mName;
|
|
|
private $mCardType;
|
|
|
private $mAmount;
|
|
@@ -52,12 +50,10 @@ class ctl_itemex
|
|
|
{
|
|
|
return $this->mName;
|
|
|
}
|
|
|
-
|
|
|
public function priority()
|
|
|
{
|
|
|
return $this->mPriority;
|
|
|
}
|
|
|
-
|
|
|
public function storge()
|
|
|
{
|
|
|
return $this->mStorge;
|
|
@@ -97,21 +93,22 @@ class ctl_itemex
|
|
|
$this->mNotifyTime = 300;
|
|
|
}
|
|
|
}
|
|
|
+ public function update_maxspeeds($speed)
|
|
|
+ {
|
|
|
+ $this->mMaxSpeed = $speed;
|
|
|
+ }
|
|
|
public function max_speed()
|
|
|
{
|
|
|
return $this->mMaxSpeed;
|
|
|
}
|
|
|
public function speed_overload(): bool
|
|
|
{
|
|
|
- if ($this->mMaxSpeed < 0) {
|
|
|
- return false;
|
|
|
- } elseif ($this->mMaxSpeed == 0) {
|
|
|
+ if ($this->mMaxSpeed == 0) {
|
|
|
return true;
|
|
|
} else {
|
|
|
return $this->mSpeed >= $this->mMaxSpeed;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
public function cur_speed()
|
|
|
{
|
|
|
return $this->mSpeed;
|
|
@@ -127,13 +124,8 @@ class ctl_itemex
|
|
|
}
|
|
|
public function need_feed()
|
|
|
{
|
|
|
- if(self::feed_threshold >= $this->mMaxSpeed) {
|
|
|
- return $this->mMonitorCommit < $this->mMaxSpeed;
|
|
|
- } else {
|
|
|
- return $this->mMonitorCommit < self::feed_threshold;
|
|
|
- }
|
|
|
+ return $this->mMonitorCommit < $this->mMaxSpeed;
|
|
|
}
|
|
|
-
|
|
|
public function compile_val($profit_ratio)
|
|
|
{
|
|
|
$time_factor = 60;
|