49 lines
1.4 KiB
PHP
49 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Database\Factories\ScenarioRunFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ScenarioRun extends Model
|
|
{
|
|
/** @use HasFactory<ScenarioRunFactory> */
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'benchmark_run_id', 'ran_at', 'scenario', 'level', 'ok', 'outcome',
|
|
'wall', 'turns', 'commands', 'repeats', 'submissions', 'rejected',
|
|
't_first_sub', 'n_first_sub', 't_pass', 'n_pass',
|
|
'gen_tokens', 'vis_tokens', 'rea_tokens', 'verdicts', 'detail', 'payload',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'ran_at' => 'datetime',
|
|
'ok' => 'boolean',
|
|
'wall' => 'float',
|
|
'turns' => 'integer',
|
|
'commands' => 'integer',
|
|
'repeats' => 'integer',
|
|
'submissions' => 'integer',
|
|
'rejected' => 'integer',
|
|
't_first_sub' => 'float',
|
|
'n_first_sub' => 'integer',
|
|
't_pass' => 'float',
|
|
'n_pass' => 'integer',
|
|
'gen_tokens' => 'integer',
|
|
'vis_tokens' => 'integer',
|
|
'rea_tokens' => 'integer',
|
|
'verdicts' => 'array',
|
|
'payload' => 'array',
|
|
];
|
|
}
|
|
|
|
public function run(): BelongsTo
|
|
{
|
|
return $this->belongsTo(BenchmarkRun::class, 'benchmark_run_id');
|
|
}
|
|
}
|