---
include_toc: true
---

# d-branch.md

## D-BRANCH

Expansions and modulations:
- is expanded by: [NEURON](neuron.md)
- expands: [POSTSYNAPSE](postsynapse.md)

```Gen
D-BRANCH
  type: comprehension

  include: posynapse.md
  
  expansion:
    _@postsynapse: TUB [ comprehension: POSTSYNAPSE, full: 50x, active: 0x, empty: 10x ]

  intrication:

    # Scope
    !DAY: INTRICATION [ ref: &ORGANISM.!DAY ]
    !NIGHT: INTRICATION [ ref: &ORGANISM.!NIGHT ]

    # Context
    *VPostMax: CONTEXT []
    *VPostMedium: CONTEXT []
    *VPostLow: CONTEXT []

    # Tub
    _VDB: INTRICATION [ ref: &SOMA._VDB )

  
  instantiation:

    # Tub
    _VPost: TUB [ full: 50x, active: 0x, empty: 10x ] 

    # Behaviour
    $: BEHAVIOUR [ behaviour: MAIN_DBRANCH ]
```

---

**Tubs:**

- **VPost**: e' l'integrazione degli EPSP della postsinapse

---

### MAIN_DBRANCH: !DAY

```Gen
MAIN_DBRANCH
  type: behaviour

  within_scope: !DAY

  snippet:
    # *Fixed
    @: CONTEXTOR [ snippet: CheckVPost, rf: active 60x ]
    @: ACCUMULATOR [ snippet: VDBClearance, rf: active 2x ]
    # *VPostMax
    @: ACCUMULATOR [ snippet: VDBMax, rf: active 2x ]
    # *VPostMedium
    @: ACCUMULATOR [ snippet: VDBMed, rf: active 4x ]
    # *VPostLow
    @: ACCUMULATOR [ snippet: VDBMin, rf: active 8x ]
    
```
#### *Fixed

##### CheckVPost

Contestualizziamo in maniera Fixed?

```Gen
CheckVPost
  type: contextor
  
  in_context: *Fixed
    condition: _VPost fullness
        out_context: *VPostMax
    condition: _VPost mediumness
        out_context: *VPostMedium 
    condition: _VPost emptiness
        out_context: *VPostLow
```

##### VDBClearance
Qui facciamo il clearance del VDB. Lo facciamo in questo modo perche' abbiamo semplificato quello che succede fra BD e SOMA.
Qui posso aggiungere il flush, clearance veloce quando c'e' il bAP.

```Gen
VDBClearance
  in_context: *Fixed

 hypothesis: NOT _VDB empty
    action: [ _VDB decrease ] 
    trace: 
```
#### *VPostMax
##### VDBMax

```Gen
VDBMax
  in_context: *VPostMax

  hypothesis: NOT _VDB full
    action: [ _VDB increase ]
    trace: 
```
#### *VPostMedium
##### VDBMed

```Gen
VDBMed
  in_context: *VPostMedium

  hypothesis: NOT _VDB full
    action: [ _VDB increase ]
    trace: 
```
#### *VPostLow
##### VDBLow

```Gen
  in_context: *VPostLow

  hypothesis: NOT _VDB full
    action: [ _VDB increase ]
    trace: 
```
