mPrefix = "{$chname}-{$quality}-{$card_type}-{$amount}"; $this->mName = $chname; $this->mCardType = $card_type; $this->mAmount = $amount; $this->mQuality = $quality; $this->mMaxSpeed = $max_speed; $this->mPriority = $priority; $this->mStorge = $storge; $this->mOpened = $opened; $this->mPrice = 0.0; $this->mSpeed = 0; $this->mRatio =0.0; $this->mRatioCommit = 0; $this->mNotifyTime = 0; $this->mMonitorCommit = 0; } public function name() { return $this->mName; } public function priority() { return $this->mPriority; } public function storge() { return $this->mStorge; } public function opened() { return $this->mOpened; } public function quality() { return $this->mQuality; } public function spec() { return $this->mAmount; } public function card_type() { return $this->mCardType; } public function set_price($price) { $this->mPrice = $price; } public function price() { return $this->mPrice; } public function prefix() { return $this->mPrefix; } public function update_params($parms) { [$this->mSpeed, $this->mRatio, $this->mRatioCommit, $this->mNotifyTime,$this->mMonitorCommit] = $parms; if($this->mNotifyTime == 0) { $this->mNotifyTime = 1; } } public function max_speed() { return $this->mMaxSpeed; } public function speed_overload(): bool { if ($this->mMaxSpeed < 0) { return false; } elseif ($this->mMaxSpeed == 0) { return true; } else { return $this->mSpeed >= $this->mMaxSpeed; } } public function cur_speed() { return $this->mSpeed; } public function notify_ratio() { return $this->mRatio; } public function submits() { return $this->mRatioCommit; } public function notify_time() { return $this->mNotifyTime; } public function need_feed() { if(self::feed_threshold >= $this->mMaxSpeed) { return $this->mMonitorCommit < $this->mMaxSpeed; } else { return $this->mMonitorCommit < self::feed_threshold; } } public function compile_val($profit_ratio) { $val = $this->mRatio * $profit_ratio * 100 / $this->mNotifyTime; return round($val,5); } }