Packages
Faber TWEANN - Topology and Weight Evolving Artificial Neural Networks
Current section
Files
Jump to
Current section
Files
assets/mutation-sequence.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="900" height="700" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arrowhead" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
<polygon points="0 0, 10 3, 0 6" fill="#333" />
</marker>
</defs>
<!-- Title -->
<text x="450" y="30" text-anchor="middle" font-size="20" font-weight="bold">Mutation Process Sequence</text>
<text x="450" y="50" text-anchor="middle" font-size="12" fill="#666">How agents evolve through genetic mutations</text>
<!-- Participants -->
<rect x="50" y="80" width="120" height="40" fill="#dc2626" stroke="#991b1b" stroke-width="2" rx="5"/>
<text x="110" y="105" text-anchor="middle" font-size="12" fill="white" font-weight="bold">PopMonitor</text>
<rect x="240" y="80" width="120" height="40" fill="#ea580c" stroke="#c2410c" stroke-width="2" rx="5"/>
<text x="300" y="105" text-anchor="middle" font-size="12" fill="white" font-weight="bold">Selection</text>
<rect x="430" y="80" width="120" height="40" fill="#dc2626" stroke="#991b1b" stroke-width="2" rx="5"/>
<text x="490" y="105" text-anchor="middle" font-size="12" fill="white" font-weight="bold">Mutator</text>
<rect x="620" y="80" width="120" height="40" fill="#2563eb" stroke="#1d4ed8" stroke-width="2" rx="5"/>
<text x="680" y="105" text-anchor="middle" font-size="12" fill="white" font-weight="bold">Genotype</text>
<rect x="810" y="80" width="80" height="40" fill="#64748b" stroke="#475569" stroke-width="2" rx="5"/>
<text x="850" y="105" text-anchor="middle" font-size="11" fill="white" font-weight="bold">Logger</text>
<!-- Lifelines -->
<line x1="110" y1="120" x2="110" y2="650" stroke="#cbd5e1" stroke-width="2" stroke-dasharray="5,5"/>
<line x1="300" y1="120" x2="300" y2="650" stroke="#cbd5e1" stroke-width="2" stroke-dasharray="5,5"/>
<line x1="490" y1="120" x2="490" y2="650" stroke="#cbd5e1" stroke-width="2" stroke-dasharray="5,5"/>
<line x1="680" y1="120" x2="680" y2="650" stroke="#cbd5e1" stroke-width="2" stroke-dasharray="5,5"/>
<line x1="850" y1="120" x2="850" y2="650" stroke="#cbd5e1" stroke-width="2" stroke-dasharray="5,5"/>
<!-- Sequence -->
<!-- 1. Selection -->
<rect x="105" y="160" width="10" height="80" fill="#dc2626" opacity="0.3"/>
<line x1="110" y1="180" x2="300" y2="180" stroke="#333" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="205" y="175" text-anchor="middle" font-size="10">1. select_survivors(Pop)</text>
<rect x="295" y="200" width="10" height="20" fill="#ea580c" opacity="0.3"/>
<line x1="300" y1="220" x2="110" y2="220" stroke="#333" stroke-width="2" stroke-dasharray="3,3" marker-end="url(#arrowhead)"/>
<text x="205" y="215" text-anchor="middle" font-size="10">Survivors</text>
<!-- 2. Clone for offspring -->
<line x1="110" y1="260" x2="680" y2="260" stroke="#333" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="395" y="255" text-anchor="middle" font-size="10">2. clone_agent(ParentId)</text>
<rect x="675" y1="280" width="10" height="40" fill="#2563eb" opacity="0.3"/>
<text x="720" y="295" font-size="9" fill="#64748b">Deep copy genotype</text>
<text x="720" y="310" font-size="9" fill="#64748b">Assign new ID</text>
<line x1="680" y1="330" x2="110" y2="330" stroke="#333" stroke-width="2" stroke-dasharray="3,3" marker-end="url(#arrowhead)"/>
<text x="395" y="325" text-anchor="middle" font-size="10">OffspringId</text>
<!-- 3. Mutation -->
<line x1="110" y1="370" x2="490" y2="370" stroke="#333" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="300" y="365" text-anchor="middle" font-size="10">3. mutate(OffspringId)</text>
<!-- 4. Log start -->
<rect x="485" y="390" width="10" height="220" fill="#dc2626" opacity="0.3"/>
<line x1="490" y1="400" x2="850" y2="400" stroke="#333" stroke-width="1.5" marker-end="url(#arrowhead)"/>
<text x="670" y="395" text-anchor="middle" font-size="9">debug(starting mutation)</text>
<!-- 5. Calculate mutation count -->
<line x1="490" y1="430" x2="680" y2="430" stroke="#333" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="585" y="425" text-anchor="middle" font-size="10">4. read(agent)</text>
<line x1="680" y1="450" x2="490" y2="450" stroke="#333" stroke-width="2" stroke-dasharray="3,3" marker-end="url(#arrowhead)"/>
<text x="585" y="445" text-anchor="middle" font-size="10">Agent</text>
<text x="580" y="475" font-size="9" fill="#64748b">Calculate mutations</text>
<text x="580" y="490" font-size="9" fill="#64748b">based on neuron count</text>
<!-- 6. Select operator -->
<text x="580" y="520" font-size="9" fill="#64748b">Select mutation</text>
<text x="580" y="535" font-size="9" fill="#64748b">via roulette wheel</text>
<!-- 7. Apply mutation -->
<line x1="490" y1="555" x2="680" y2="555" stroke="#333" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="585" y="550" text-anchor="middle" font-size="10">5. add_neuron(AgentId)</text>
<rect x="675" y="570" width="10" height="60" fill="#2563eb" opacity="0.3"/>
<text x="720" y="590" font-size="9" fill="#64748b">Find connection</text>
<text x="720" y="605" font-size="9" fill="#64748b">Insert new neuron</text>
<text x="720" y="620" font-size="9" fill="#64748b">Update topology</text>
<!-- 8. Log completion -->
<line x1="490" y1="640" x2="850" y2="640" stroke="#333" stroke-width="1.5" marker-end="url(#arrowhead)"/>
<text x="670" y="635" text-anchor="middle" font-size="9">debug(mutation succeeded)</text>
<!-- 9. Return -->
<line x1="490" y1="670" x2="110" y2="670" stroke="#333" stroke-width="2" stroke-dasharray="3,3" marker-end="url(#arrowhead)"/>
<text x="300" y="665" text-anchor="middle" font-size="10">ok</text>
<!-- Mutation types box -->
<rect x="20" y="450" width="150" height="180" fill="#fef3c7" stroke="#f59e0b" stroke-width="1" rx="3"/>
<text x="95" y="470" text-anchor="middle" font-size="10" font-weight="bold">Mutation Operators:</text>
<text x="30" y="490" font-size="9">Topological:</text>
<text x="35" y="508" font-size="8">• add_neuron</text>
<text x="35" y="523" font-size="8">• add_link</text>
<text x="35" y="538" font-size="8">• add_sensor</text>
<text x="30" y="560" font-size="9">Parametric:</text>
<text x="35" y="578" font-size="8">• mutate_weights</text>
<text x="35" y="593" font-size="8">• mutate_af</text>
<text x="35" y="608" font-size="8">• mutate_aggr_f</text>
<text x="30" y="625" font-size="8" fill="#64748b">Selected by probability</text>
<!-- Repeat indicator -->
<rect x="760" y="350" width="120" height="50" fill="#dbeafe" stroke="#2563eb" stroke-width="1" rx="3"/>
<text x="820" y="370" text-anchor="middle" font-size="9" font-weight="bold">Repeats for</text>
<text x="820" y="385" text-anchor="middle" font-size="9" font-weight="bold">mutation count</text>
<text x="820" y="398" text-anchor="middle" font-size="8" fill="#64748b">(e.g., 1-5 mutations)</text>
<!-- Phases -->
<rect x="200" y="145" width="50" height="18" fill="#fecaca" stroke="#dc2626" stroke-width="1" rx="3"/>
<text x="225" y="158" text-anchor="middle" font-size="9" font-weight="bold">SELECT</text>
<rect x="200" y="245" width="50" height="18" fill="#bfdbfe" stroke="#2563eb" stroke-width="1" rx="3"/>
<text x="225" y="258" text-anchor="middle" font-size="9" font-weight="bold">CLONE</text>
<rect x="200" y="355" width="50" height="18" fill="#fde68a" stroke="#f59e0b" stroke-width="1" rx="3"/>
<text x="225" y="368" text-anchor="middle" font-size="9" font-weight="bold">MUTATE</text>
</svg>