| 1 | package Sim::Agent::Engine; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | package Sim::Agent::Engine; | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | sub dependencies_satisfied | ||||||||||||||||||||
| 12 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
dependencies_satisfied: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||
| 13 | 0 | my ($agent, $state) = @_; | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 0 | ▶ | return 1 unless @{ $agent->{wait_for} || [] }; | ||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$agent->{'wait_for'} || []
MC/DC0%0/1
$agent->{'wait_for'} || []
$agent->{'wait_for'}
Truth table0%0/2
A
A= $agent->{'wait_for'}
| |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 0 | for my $dep (@{ $agent->{wait_for} }) | |||||||||||||||||||
| 18 | { | ||||||||||||||||||||
| 19 | 0 | ▶ | return 0 unless exists $state->{completed}->{$dep}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 20 | 0 | ▶ | return 0 unless $state->{completed}->{$dep}->{status} eq 'ok'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 0 | return 1; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | sub is_enqueued_or_active | ||||||||||||||||||||
| 27 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
is_enqueued_or_active: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||
| 28 | 0 | my ($state, $agent) = @_; | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | ▶ | return 1 if $state->{active}->{$agent}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 0 | for my $queued (@{ $state->{queue} }) | |||||||||||||||||||
| 33 | { | ||||||||||||||||||||
| 34 | 0 | ▶ | return 1 if $queued eq $agent; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 0 | return 0; | |||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 1 | 1; | |||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | =pod | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | =head1 NAME | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | Sim::Agent::Engine - Small pure helper routines used by the runner | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | =head1 DESCRIPTION | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | Internal helpers used by the runner (e.g. dependency checks, queue guards). Intentionally minimal and side-effect free. | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | See L<Sim::Agent>. | ||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | =head1 AUTHOR | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | Gian Luca Brunetti (2026), gianluca.brunetti@gmail.com | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | =head1 LICENSE | ||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | The GNU General Public License v3.0 | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | =cut | ||||||||||||||||||||
| 64 | |||||||||||||||||||||