Статья Insect Homeostat Model
Короткий адрес страницы: fornit.ru/71587 
Озвучка:

Относится к сборнику статей теори МВАП https://t.me/thinking_cycles

Insect Homeostat Model

Russian version
The foundation of any individual system of significance is the insect homeostatic regulation model—a framework common to organisms whose nervous systems are no more complex than those of flies, bees, ants, and similar insects. This model supports responses ranging up to conditioned reflexes.

The software-based organization of this homeostatic foundation, described in the article “Principles of Emotion Formation in Artificial Living Beings” (fornit.ru/71550), along with a code implementation example (emotion_code.docx), serves as the universal basis for all living organisms, regardless of their organizational complexity.

For simple insects, this model lacks evolutionary superstructures such as higher-order "vital parameters" (e.g., “Need for Social Interaction”) and instead focuses entirely on full adaptation to environmental conditions through inherited (innate) reactions and, in ontogeny, conditioned reflexes.

Therefore, illustrating this simplest foundation—and the interaction of its adaptive life-maintenance principles—provides the clearest starting point for understanding more complex models that incorporate social mechanisms for experience transmission.

No social mechanisms of nurturing—such as those used for helpless, infantile organisms that rely on social learning—are applicable here. An insect is born with a complete set of survival reactions and adapts to specific environmental features solely through conditioned reflexes.


Example Set of Insect Vital Parameters

VitalsArr = {

  Id = 1, importance = 90   // Hypoxia / Oxygen deficit 

  Id = 2, importance = 80   // Dehydration / Water deficit 

  Id = 3, importance = 70   // Overheating 

  Id = 4, importance = 60   // Overcooling 

  Id = 5, importance = 60   // Hunger (energy deficit) 

  Id = 6, importance = 30   // Stress (consolidation of defensive systems) 

  Id = 7, importance = 20   // Mating drive (sexual activity) 

  Id = 8, importance = 50   // Self-preservation 

  Id = 9, importance = 100  // Physical injury 

}

This aligns with key homeostatic needs identified in entomological literature. All parameters have direct physiological correlates and trigger adaptive behavioral responses well-documented in insect studies.

For all vitals, an increase from zero (the norm) indicates worsening of the parameter.
The first five reflect needs ranked by decreasing importance, ensuring priority-driven behavioral responses to restore homeostasis.


Biological Justification and Correspondence to Data

Vital

Biological Basis

Hypoxia

Insects breathe through tracheae. Blockage of spiracles (e.g., by water, pollen, parasites) or high CO concentration is lethal. Many insects are sensitive to O/CO ratios. Mosquito larvae regulate depth in water; terrestrial species avoid confined spaces. Behavior is activated to clear spiracles or exit low-O/high-CO zones. Aquatic larvae surface for air.

Dehydration

Due to high surface-area-to-volume ratio, water loss is critical. Insects seek moisture, close spiracles (if present), and reduce activity. Stimulates water-seeking: drinking droplets, plant sap, or moist substrates. May suppress activity during hot periods to minimize water loss.

Overheating / Overcooling

Insects are ectotherms. Activity sharply declines outside thermal optimum. Behavioral thermoregulation (basking, sheltering) is well-established. Overheating triggers shade-seeking, burrowing, or nocturnal activity. Overcooling drives sun-basking, body orientation perpendicular to rays, and reduced immobility.

Hunger

A universal behavioral driver. Confirmed in foraging studies of Drosophila, wasps, ants, etc. Activates food-seeking (foraging). Target resource varies by species and life stage: nectar, foliage, chitin, blood, etc.

Stress

Generalized response to non-specific threats (vibration, sudden light, chemicals). In insects, mediated by juvenile hormone and octopamine. Defined not as subjective feeling, but as physiological/behavioral consolidation of defense systems. Triggers freezing (thanatosis), sheltering, or premature escape. Low priority—often brief and not requiring sustained behavioral programs.

Mating Drive

Regulated by pheromones and hormones (e.g., ecdysone), strictly tied to adult (imago) stage. Well-documented in butterflies, beetles, flies. Activated only when core homeostatic parameters are satisfied. Requires sexual maturity and external cues (pheromones, visual partner cues). Triggers partner search, courtship displays, copulation.

Self-preservation

Escape reflexes, freezing, camouflage. Observed in cockroaches, cicadas, ladybugs. Differs from “Stress” by being more targeted and active: fleeing, threat postures, jumping, repellent secretion.

Injury

Insects exhibit nociception (damage sensitivity), including protective movements and withdrawal. Causes immobilization to reduce hemolymph loss, wound cleaning, sheltering. May trigger compensatory feeding for hemolymph restoration.


When a vital parameter exceeds a critical threshold, it activates a behavioral style aimed at restoring homeostasis.
This mechanism corresponds to the reflex-instinctive regulatory level in animals, including insects:

  1. Hunger → Feeding + Search – locates and consumes resources.
  2. Overheating → Search (for shade) + Protection – reduces thermal load.
  3. Injury → Protection + Stress – minimizes further damage.

These reactions depend on perception of current environmental conditions. External stimuli (odor, thermal gradient, humidity), combined with an active vital (e.g., hunger, overheating, dehydration), refine the target of the search behavior. Thus, the refining factor can be both external sensory input and internal vital reception.


The system continuously monitors the deviation from norm (DeviationFromNorm) for each vital.
When a threshold is exceeded (DeviationFromNorm[id] < -Threshold), the vital is marked as an “active driver.”

Each active driver is rigidly linked to one or more basic behavioral contexts (BasicContexts), whose evolutionary function is to compensate for that specific deviation.

Behavior continues until:


Basic Behavioral Contexts for Insects

func getActiveBasicContexts() {

  // Reset all contexts EXCEPT special ones (e.g., circadian rest)

  for i = 1 to 10 {

    if i == 10 // Do not reset Circadian rhythm

      break

    BasicContextsActived[i] = false

  }

 

  // Injury (Id=9)

  if DeviationFromNorm[9] < -50 {

    BasicContextsActived[9] = true  // Immobilization & wound care

    return  // Highest priority—override all else

  }

 

  // Hypoxia (Id=1)

  if DeviationFromNorm[1] < -20 {

    BasicContextsActived[1] = true  // Ventilation

    return

  }

 

  // Dehydration (Id=2)

  if DeviationFromNorm[2] < -30 {

    BasicContextsActived[2] = true  // Water intake

    return

  }

 

  // Overheating (Id=3)

  if DeviationFromNorm[3] < -40 {

    BasicContextsActived[3] = true  // Cooling

    return

  }

 

  // Overcooling (Id=4)

  if DeviationFromNorm[4] < -50 {

    BasicContextsActived[4] = true  // Warming

    return

  }

 

  // In resting state, insects retain oxygen-deficit response,

  // but vigilance (stress/threat reactions) may be reduced.

  // Principle: during rest, suppress energy-intensive behaviors

  // (e.g., locomotion), but retain automatic life-saving reflexes.

 

  if BasicContextsActived[10] { // Rest mode active (externally triggered)

    return  // Suppress all non-essential activities

  }

 

  // Hunger (Id=5)

  if DeviationFromNorm[5] < -60 {

    BasicContextsActived[5] = true  // Foraging

    return

  }

 

  // Stress (Id=6)

  if DeviationFromNorm[6] < -50 {

    BasicContextsActived[6] = true   // Freezing

    BasicContextsActived[8] = false  // Incompatible with threat avoidance

    return

  }

 

  // Mating drive (Id=7)

  if DeviationFromNorm[7] < -70 {

    BasicContextsActived[7] = true  // Reproductive behavior

    return

  }

 

  // Self-preservation (Id=8)

  if DeviationFromNorm[8] < -50 {

    BasicContextsActived[8] = true  // Threat avoidance

    return

  }

}

As incipient social behaviors, one could add styles typical of ants, bees, or termites:

However, this would unnecessarily complicate the model and its demonstration.


Insects lack a basic self-awareness (as seen in organisms with psyche), so they do not experience states like “Bad,” “Normal,” or “Good.”
Thus, active behavioral styles (BasicContextsActived) are triggered only when a vital exceeds a critical deviation (DeviationFromNorm is a negative percentage indicating worsening).

Although there is no “Good” state, its functional role—sustaining corrective actions until homeostasis is restored—must still be implemented: the behavior continues as long as the vital is improving.
In software models, normalization may be instantaneous upon reaction initiation, so this functionality is not strictly necessary in insect-level models.


Function to Activate Basic Behavioral Contexts

func getActiveBasicContexts() {

  // Reset all contexts EXCEPT special ones (e.g., circadian rest)

  for i = 1 to 10 {

    if i == 10 // Do not reset Circadian rhythm

      break

    BasicContextsActived[i] = false

  }

 

  // Injury (Id=9)

  if DeviationFromNorm[9] < -50 {

    BasicContextsActived[9] = true  // Immobilization & wound care

    return  // Highest priority—override all else

  }

 

  // Hypoxia (Id=1)

  if DeviationFromNorm[1] < -20 {

    BasicContextsActived[1] = true  // Ventilation

    return

  }

 

  // Dehydration (Id=2)

  if DeviationFromNorm[2] < -30 {

    BasicContextsActived[2] = true  // Water intake

    return

  }

 

  // Overheating (Id=3)

  if DeviationFromNorm[3] < -40 {

    BasicContextsActived[3] = true  // Cooling

    return

  }

 

  // Overcooling (Id=4)

  if DeviationFromNorm[4] < -50 {

    BasicContextsActived[4] = true  // Warming

    return

  }

 

  // In resting state, insects retain oxygen-deficit response,

  // but vigilance (stress/threat reactions) may be reduced.

  // Principle: during rest, suppress energy-intensive behaviors

  // (e.g., locomotion), but retain automatic life-saving reflexes.

 

  if BasicContextsActived[10] { // Rest mode active (externally triggered)

    return  // Suppress all non-essential activities

  }

 

  // Hunger (Id=5)

  if DeviationFromNorm[5] < -60 {

    BasicContextsActived[5] = true  // Foraging

    return

  }

 

  // Stress (Id=6)

  if DeviationFromNorm[6] < -50 {

    BasicContextsActived[6] = true   // Freezing

    BasicContextsActived[8] = false  // Incompatible with threat avoidance

    return

  }

 

  // Mating drive (Id=7)

  if DeviationFromNorm[7] < -70 {

    BasicContextsActived[7] = true  // Reproductive behavior

    return

  }

 

  // Self-preservation (Id=8)

  if DeviationFromNorm[8] < -50 {

    BasicContextsActived[8] = true  // Threat avoidance

    return

  }

}

This model can be implemented by any intermediate-level programmer in any convenient language, requiring minimal computational resources—even running smoothly on a low-end PC.
Avoiding neuron emulation (fornit.ru/art10) enables real-time, resource-efficient complex adaptive systems.

This is a minimalist yet complete model of reflex-instinctive behavior, aligned with both biological reality and engineering practicality.


Innate Reactions Linked to Basic Contexts

For each BasicContext, we now attach innate reactions that restore homeostasis, triggered by evolutionarily pre-programmed perceptual cues:

BasicContext

Perceptual Cue

Innate Reaction

id=1 Ventilation

Spiracle blockage (pressure/humidity sensors)

Body shaking, leg cleaning, move to airflow

id=2 Water intake

Wet surface, water droplets (hydrosensors)

Approach, drink, cuticular absorption

id=3 Cooling

High temperature, bright light

Move to shade, burrow, align body parallel to sun

id=4 Warming

Low temperature

Seek sun patch, wing vibration (thermogenesis)

id=5 Foraging

Smell of nectar/decay/pheromones (chemoreceptors)

Approach, sample, consume

id=6 Freezing

Shadow, vibration, sudden sound

Complete immobility (thanatosis) for 10–60 sec

id=7 Mating

Partner pheromone, visual image

Approach, courtship display, copulation

id=8 Avoidance

Moving threat, alarm pheromone

Flee, jump, take shelter

id=9 Immobilization

Cuticle rupture, hemolymph loss

Curl up, clean wound, suppress movement

id=10 Rest

Time of day (internal clock)

Cease activity, except vital reflexes

These reactions are hard-coded and do not require learning.


Ontogenetic Development: Conditioned Reflexes

To account for individual environmental adaptation during ontogeny, a conditioned reflex structure and its activation function must be added.

See the example implementation in the base model:  emotion_code_insects_e.docx


Авторизованные пользователи могут оставлять комментарии.