penjadwalan-ga/resources/views/admin/exports/presentation/sheet3-selection.blade.php

82 lines
6.0 KiB
PHP

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"></head>
<body>
<table>
<!-- Header Info -->
<tr>
<td colspan="6" style="font-size: 14pt; font-weight: bold; color: #1E293B; height: 30px;">3. SIMULASI OPERATOR SELEKSI (TOURNAMENT SELECTION, k=3)</td>
</tr>
<tr>
<td colspan="6" style="font-size: 10pt; color: #64748B;">Memilih 3 kandidat acak dari populasi Gen 0, membandingkan fitness, dan mengambil pemenang (Fitness Tertinggi) sebagai Induk</td>
</tr>
<tr><td colspan="6" style="height: 10px;"></td></tr>
<!-- Tournament 1 (Memilih Induk A) -->
<tr>
<td colspan="6" style="background-color: #1E293B; color: #FFFFFF; font-weight: bold; height: 25px;">A. PROSES SELEKSI INDUK 1 (PARENT A)</td>
</tr>
<thead>
<tr>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: center; border: 1px solid #0F172A; width: 120px;">Role Kandidat</th>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: center; border: 1px solid #0F172A; width: 120px;">No Individu</th>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: center; border: 1px solid #0F172A; width: 120px;">Nilai Fitness</th>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: center; border: 1px solid #0F172A; width: 120px;">Total Penalti</th>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: center; border: 1px solid #0F172A; width: 150px;">Hasil Evaluasi</th>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: left; border: 1px solid #0F172A; width: 250px;">Keterangan Seleksi</th>
</tr>
</thead>
<tbody>
@foreach($sim['tournament1']['candidates'] as $idx => $cand)
@php
$isWinner = $cand['index'] == $sim['tournament1']['winner']['index'];
$bgColor = $isWinner ? '#DCFCE7' : '#FFFFFF';
$badgeText = $isWinner ? 'WINNER (Parent A)' : 'Eliminated';
@endphp
<tr>
<td style="text-align: center; border: 1px solid #CBD5E1; font-weight: bold;">Kandidat {{ $idx + 1 }}</td>
<td style="text-align: center; border: 1px solid #CBD5E1; font-weight: bold; background-color: {{ $bgColor }};">Individu [{{ $cand['index'] }}]</td>
<td style="text-align: center; border: 1px solid #CBD5E1; font-weight: bold; background-color: {{ $bgColor }};">{{ number_format($cand['fitness'], 4) }}</td>
<td style="text-align: center; border: 1px solid #CBD5E1;">{{ $cand['total_penalti'] }}</td>
<td style="text-align: center; border: 1px solid #CBD5E1; font-weight: bold; background-color: {{ $bgColor }}; color: {{ $isWinner ? '#166534' : '#64748B' }};">{{ $badgeText }}</td>
<td style="border: 1px solid #CBD5E1;">{{ $isWinner ? 'Fitness tertinggi di antara 3 kandidat' : 'Kalah nilai fitness' }}</td>
</tr>
@endforeach
</tbody>
<tr><td colspan="6" style="height: 15px;"></td></tr>
<!-- Tournament 2 (Memilih Induk B) -->
<tr>
<td colspan="6" style="background-color: #1E293B; color: #FFFFFF; font-weight: bold; height: 25px;">B. PROSES SELEKSI INDUK 2 (PARENT B)</td>
</tr>
<thead>
<tr>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: center; border: 1px solid #0F172A; width: 120px;">Role Kandidat</th>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: center; border: 1px solid #0F172A; width: 120px;">No Individu</th>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: center; border: 1px solid #0F172A; width: 120px;">Nilai Fitness</th>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: center; border: 1px solid #0F172A; width: 120px;">Total Penalti</th>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: center; border: 1px solid #0F172A; width: 150px;">Hasil Evaluasi</th>
<th style="background-color: #334155; color: #FFFFFF; font-weight: bold; text-align: left; border: 1px solid #0F172A; width: 250px;">Keterangan Seleksi</th>
</tr>
</thead>
<tbody>
@foreach($sim['tournament2']['candidates'] as $idx => $cand)
@php
$isWinner = $cand['index'] == $sim['tournament2']['winner']['index'];
$bgColor = $isWinner ? '#DCFCE7' : '#FFFFFF';
$badgeText = $isWinner ? 'WINNER (Parent B)' : 'Eliminated';
@endphp
<tr>
<td style="text-align: center; border: 1px solid #CBD5E1; font-weight: bold;">Kandidat {{ $idx + 1 }}</td>
<td style="text-align: center; border: 1px solid #CBD5E1; font-weight: bold; background-color: {{ $bgColor }};">Individu [{{ $cand['index'] }}]</td>
<td style="text-align: center; border: 1px solid #CBD5E1; font-weight: bold; background-color: {{ $bgColor }};">{{ number_format($cand['fitness'], 4) }}</td>
<td style="text-align: center; border: 1px solid #CBD5E1;">{{ $cand['total_penalti'] }}</td>
<td style="text-align: center; border: 1px solid #CBD5E1; font-weight: bold; background-color: {{ $bgColor }}; color: {{ $isWinner ? '#166534' : '#64748B' }};">{{ $badgeText }}</td>
<td style="border: 1px solid #CBD5E1;">{{ $isWinner ? 'Fitness tertinggi di antara 3 kandidat' : 'Kalah nilai fitness' }}</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>