Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| Job | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getProfit | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Jingga |
| 4 | * |
| 5 | * PHP Version 8.1 |
| 6 | * |
| 7 | * @package phpOMS\Scheduling |
| 8 | * @copyright Dennis Eichhorn |
| 9 | * @license OMS License 2.0 |
| 10 | * @version 1.0.0 |
| 11 | * @link https://jingga.app |
| 12 | */ |
| 13 | declare(strict_types=1); |
| 14 | |
| 15 | namespace phpOMS\Scheduling; |
| 16 | |
| 17 | /** |
| 18 | * Job. |
| 19 | * |
| 20 | * @package phpOMS\Scheduling |
| 21 | * @license OMS License 2.0 |
| 22 | * @link https://jingga.app |
| 23 | * @since 1.0.0 |
| 24 | */ |
| 25 | class Job |
| 26 | { |
| 27 | public int $id = 0; |
| 28 | |
| 29 | public int $executionTime = 0; |
| 30 | |
| 31 | public float $priority = 0.0; |
| 32 | |
| 33 | public float $value = 0.0; |
| 34 | |
| 35 | public float $cost = 0.0; |
| 36 | |
| 37 | /** How many iterations has this job been on hold in the queue */ |
| 38 | public int $onhold = 0; |
| 39 | |
| 40 | /** How many iterations has this job been in process in the queue */ |
| 41 | public int $inprocessing = 0; |
| 42 | |
| 43 | public \DateTime $deadline; |
| 44 | |
| 45 | public array $steps = []; |
| 46 | |
| 47 | public function __construct() |
| 48 | { |
| 49 | $this->deadline = new \DateTime('now'); |
| 50 | } |
| 51 | |
| 52 | public function getProfit() |
| 53 | { |
| 54 | return $this->value - $this->cost; |
| 55 | } |
| 56 | } |