{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c9cb873f-868b-4de7-8fcd-babd0b5b2927",
   "metadata": {},
   "source": [
    "# Born Species\n",
    "\n",
    "MobsPy deals with meta-species in the products that do not have a match in the meta-reactants in a different way. Firstly, we refer to these species as born species. Since these species have no matching meta-species in the reactans to be used in to construct the product, MobsPy uses their default state (see Initial Conditions). \n",
    "One can also perform a query for non-default characteristics."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "3fa4c83e-e241-4a82-aa9b-e6c1334c9eeb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Species\n",
      "Something.big.old,0\n",
      "Something.big.young,0\n",
      "Something.small.old,0\n",
      "Something.small.young,0\n",
      "\n",
      "Mappings\n",
      "Something :\n",
      "Something.big.old\n",
      "Something.big.young\n",
      "Something.small.old\n",
      "Something.small.young\n",
      "\n",
      "Parameters\n",
      "volume,1\n",
      "\n",
      "Reactions\n",
      "reaction_0,{'re': [], 'pr': [(1, 'Something.big.young')], 'kin': '1'}\n",
      "reaction_1,{'re': [], 'pr': [(1, 'Something.small.young')], 'kin': '1'}\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Compiling model\n"
     ]
    }
   ],
   "source": [
    "from mobspy import *\n",
    "\n",
    "Age, Size = BaseSpecies()\n",
    "\n",
    "Age.young, Age.old\n",
    "Size.small, Size.big\n",
    "\n",
    "Something = Age*Size\n",
    "\n",
    "Zero >> Something [1]\n",
    "Zero >> Something.big [1]\n",
    "\n",
    "S_1 = Simulation(Something)\n",
    "print(S_1.compile())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "819b0242-9ed9-4c17-8add-2fca1a1f5749",
   "metadata": {},
   "source": [
    "If one wishes to change this they can use the All operator. With the All operator, all possible states of the meta-species in the product will be used to generate a reaction. Much like the previous case queries can be performed and \n",
    "here they will act as a filter to determine the subset of all states that will be used in the product."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "59ddce43-f862-4264-a70e-915c4b8a1d48",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Species\n",
      "Something.big.old,0\n",
      "Something.big.young,0\n",
      "Something.small.old,0\n",
      "Something.small.young,0\n",
      "\n",
      "Mappings\n",
      "Something :\n",
      "Something.big.old\n",
      "Something.big.young\n",
      "Something.small.old\n",
      "Something.small.young\n",
      "\n",
      "Parameters\n",
      "volume,1\n",
      "\n",
      "Reactions\n",
      "reaction_0,{'re': [], 'pr': [(1, 'Something.big.old')], 'kin': '1'}\n",
      "reaction_1,{'re': [], 'pr': [(1, 'Something.big.old')], 'kin': '2'}\n",
      "reaction_2,{'re': [], 'pr': [(1, 'Something.big.young')], 'kin': '1'}\n",
      "reaction_3,{'re': [], 'pr': [(1, 'Something.big.young')], 'kin': '2'}\n",
      "reaction_4,{'re': [], 'pr': [(1, 'Something.small.old')], 'kin': '1'}\n",
      "reaction_5,{'re': [], 'pr': [(1, 'Something.small.young')], 'kin': '1'}\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Compiling model\n"
     ]
    }
   ],
   "source": [
    "from mobspy import *\n",
    "\n",
    "Age, Size = BaseSpecies()\n",
    "\n",
    "Age.young, Age.old\n",
    "Size.small, Size.big\n",
    "\n",
    "Something = Age*Size\n",
    "\n",
    "Zero >> All[Something] [1]\n",
    "Zero >> All[Something.big] [2]\n",
    "\n",
    "S_1 = Simulation(Something)\n",
    "print(S_1.compile())"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
