Natural numbers - SN P systems

Description

This is one of the basic examples of spiking neural P systems (SN P systems, for short) presented in the seminal paper of this paradigm. More specifically, it is a generator of natural numbers, as presented in [1] and also appeared in [2]. It would be similar to this:

../../_images/naturalnumbersspiking.png

Model

The corresponding P-Lingua file is the following:

@model<spiking_psystems>

def main()
{
        call spiking_init_conf();
        call spiking_rules();
}

def spiking_init_conf()
{
        @mu = in, out;
        @mu += 1,2,3;
        @ms(1) = a*2;
        @ms(2) = a;
        @ms(3) = a*3;

        @marcs = (1,2);
        @marcs += (1,3);
        @marcs += (2,1);
        @marcs += (2,3);
        @marcs += (3,out);

        @min = in;
        @mout = out;
}


def spiking_rules()
{
        [a --> a]'1 "a*2";
        [a --> #]'1;
        [a --> a]'2;
        [a --> a]'2 :: 1;
        [a*3 --> a]'3;
        [a --> a]'3 :: 1;
        [a*2 --> #]'3;
}

Files

As it can be seen above, this example presents an ad-hoc model, not accepting any input parameter nor special output to check the results, so it can run with the general MeCoSim app. Only the .pli file is specific from this problem.

A description of the syntax used above and in the corresponding .pli file can be found at [3].

References