---
include_toc: true
---

# postsynapse.md

Expansions and modulations:
  - is expanded and developed by: [D_BRANCH](d-branch.md)
  - is tuned by: [ORGANISM](../../organism.md), organs, modules
  - expands and tunes: [POST-AMPA](post_ampa.md)
  - develops: _posMod, _actMod

## POSTSYNAPSE

```Gen

include: 
  post_ampa.md
  
POSTSYNAPSE

  type: comprehension

  expansion:
     _@PostAmpaAll: TUB [ comprehension: POST-AMPA, full: 10x, active: 5x, empty: 2x ]

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

    # Context  
    *bAP: INTRICATION [ ref: &SOMA.*bAP ]
    *TunPossible: INTRICATION [ ref: &NEURON.*TunPossible ]
    
    # Tub
    _NT: INTRICATION [ ref: &ASTROSYNAPSE._NT ] 
    _Vpost: INTRICATION [ ref: ??._VPost ]
   
  instantiation:
    # Context

    # Tub
    _Ca2: TUB [ full: 60x, active: 30x, empty: 0x ]
    _Na: TUB [ full: 60x, active: 30x, empty: 0x ]
    _Nox: TUB [ full: 100x, active: 20x, empty: 0x ] # Nitric Oxide (NO):  A gas that diffuses freely.
    _eCB: TUB [ full: 100x, active: 20x, empty: 0x ] # Endocannabinoids (e.g., 2-AG)
    
    _posMod: TUB [ full: None, active: ??, empty: 0x)  # riferimento a possible di BEH-PRE
    _actMod: TUB [ full: None, active: ??, empty: ??)  # riferimento a active di BEH-PRE

    # Behaviour
    $: BEHAVIOUR [ behaviour: MAIN_POST ]
    $: BEHAVIOUR [ behaviour: TUN-POST-AMPA ]

```

**Tubs:**

- **_Na**: Ioni entranti tramite AMPA receptors
- **_NT**: Neuro Trasmettitori
- **_Ca2**: Ioni entranti tramite NMDA
- **_VPost**: il voltage che viene sentito in DB
- **_eCB**:
- **_Nox**:?

### MAIN_POST: !DAY
```
MAIN_POST
  type: behaviour

  within_scope: !DAY

  snippet:
    *bAP
    @: ACCUMULATOR [ snippet: CaNDMAEnterMax, rf: active 2x ]
    @: ACCUMULATOR [ snippet: CaNDMAEnterMed, rf: active 4x ]

    NOT *bAP
    @: ACCUMULATOR [ snippet: CaNDMAEnterLow, rf: active 12x ]
    @: ACCUMULATOR [ snippet: CaNDMAEnterMedNotBap, rf: active 4x ]
    @: ACCUMULATOR [ snippet: CaClearance, rf: active 24x ]
    @: ACCUMULATOR [ snippet: VPostMax, rf: active 4x ]
    @: ACCUMULATOR [ snippet: VPostMed, rf: active 8x ]
    @: ACCUMULATOR [ snippet: VPostMin, rf: active 16x ]
    @: ACCUMULATOR [ snippet: VPostClearance, rf: active 18x ]
    @: ACCUMULATOR [ snippet: NaClearanceHigh, rf: active 4x ]
    @: ACCUMULATOR [ snippet: NaClearanceLow, rf: active 16x ]

```

#### *bAP

![post-ltp-ltd.png](.attachments/post-ltp-ltd.png)


##### CaNDMAEnterMax

```Gen
CaNDMAEnterMax
    type: accumulator

    in_context: *bAP
    
    hypothesis: NOT _Ca2 full AND
               ( _Na fullness OR _Na mediumness )
      action: [ _Ca2 increase ]
      trace: 
```

##### CaNDMAEnterMed

```Gen
CaNDMAEnterMed
    type: accumulator

    in_context: *bAP
    
    hypothesis: NOT _Ca2 full AND _Na emptiness
      action: [ _Ca2 increase ]
      trace: 
```

#### NOT *bAP

##### CaNDMAEnterLow

```Gen
CaNDMAEnterLow
    type: accumulator

    in_context: NOT *bAP
    
    hypothesis: NOT _Ca2 full AND _Na mediumness
      action: [ _Ca2 increase ]
      trace: 
```

##### CaNDMAEnterMedNotBap

```Gen
CaNDMAEnterMedNotBap
    type: accumulator

    in_context: NOT *bAP
    
    hypothesis: NOT _Ca2 full AND _Na fullness
      action: [ _Ca2 increase ]
      trace: 
```

##### CaClearance

```Gen
CaClearance # Low
    type: accumulator

    in_context: NOT *bAP
    
    hypothesis: NOT _Ca2 empty
      action: [ _Ca2 decrease ]
      trace: None
```

##### VPostMax
```Gen
VPostMa
    type: accumulator

    in_context: NOT *bAP
    
    hypothesis: _NA fullness
      action: [ _VPost increase ]
      trace: None
```

##### VPostMed
```Gen
VPostMed
    type: accumulator

    in_context: NOT *bAP

    hypothesis: _NA mediumness
      action: [ _VPost increase ]
      trace: None
```

##### VPostMin
```Gen
VPostMin
    type: accumulator

    in_context: NOT *bAP
    
    hypothesis: _NA emptiness
      action: [ _VPost increase ]
      trace: None
```

Il VPost clearance lo facciamo qui nel container dove creaiamo anche i VPost, perche' altrimenti, se lo facessimo in DB, perderemmo l'aspetto temporale della contribuzione dei singoli POST.
##### VPostClearance
```Gen
VPostClearance
    type: accumulator

    in_context: NOT *bAP

    hypothesis: NOT _VPost empty
      action: [ _VPost decrease ]
      trace: None
```

Il NA clearance lo mettiamo qui come sniplet, perche' gli AMPA creano, e questi pompano fuori. Qui non e' un problema di perdere l'integrazione temporale, perche' gli AMPA sono tutti uguali nel loro behavior. Abbiamo messo gli AMPA come container perche' cosi' possiamo modularne la numerosita'.

##### NaClearanceHigh
```Gen
NaClearanceHigh
    type: accumulator

    in_context: NOT *bAP 
  
    hypothesis: _Na mediumness OR _Na fullness
      action: [ _Na decrease ]
      trace: None
```

##### NaClearanceLow
```Gen
NaClearanceLow
    type: accumulator

    in_context: NOT *bAP 
    
    hypothesis: NOT _Na empty
      action: [ _Na decrease ]
      trace: None
```

### TUN-POST-AMPA: !DAY
```Gen
TUN-POST-AMPA
  type: behaviour
  
  activity_scope: !DAY
  
  snippet:
    # *TunPossible
    @: CONTEXTOR [ snippet: CheckTunPostAmpa, rf: active 60x ]

    # *TryTunUpPostAmpa
    @: ACCUMULATOR [ snippet: PossibleUpPostAmpaTun, rf: active 10x ]

    # *TryTunDownPostAmpa
    @: ACCUMULATOR [ snippet: PossibleDownPostAmpaTun, rf: active 10x ]
  
  
```
#### *TunPossible

##### CheckTunPostAmpa
```Gen
CheckTunPostAmpa
  type: contextor

  in_context: *TunPossible
    condition:   tbd1
    out_context: *TryTunUpPostAmpa

    condition:   tbd2
    out_context: *TryTunDownPostAmpa
```

##### PossibleUpPostAmpaTun
```Gen
PossibleUpPostAmpaTun: ( active: 10x )
  type: accumulator

  in_context: TryTunUpPostAmpa
    hypothesis:  
      action: 
      trace: 
```

##### PossibleDownPostAmpaTun
```Gen
PossibleDownPostAmpaTun
  type: accumulator

  in_context: *TryTunDownPostAmpa
    hypothesis:  
      action: 
      trace: 
```
