Skip to main content

Generalized Numerical P Systems simulator package

Project description

GNPS project

The GNPS project (Generalized Numerical P Systems) aims to create a library for simulation of different variants of Numerical P Systems (NPS).

It contains:

  • GNPS core (the core classes for NPS simulation)
  • GNPS parser (parsers for different inputs)
  • GNPS generator (generates outputs, i.e. Verilog, Amaranth and Lustre) work in progress.
  • Utils (like the main runner)

Input Files

  • System description: YAML file describing the GNPS system (required as the first argument).
  • Input file: Optional CSV file, each row representing input variable values for a simulation step. The header must match the input variable names defined in the YAML.
  • Output file: Optional CSV file, each row representing output variable values for each step.

Command Line Options

Run the simulator with:

python -m gnps <gnps_file.yaml> [input.csv] [output.csv] [options]

Options:

  • -c, --compute_mode Run in continuous compute mode (no input variables allowed)

  • -s, --steps N Number of steps to run (default: 1)

  • --csv Output in CSV format in continuous compute mode

  • gnps_file (YAML): Required. GNPS system description.

  • input (CSV): Optional. Input values per step (default: stdin).

  • output (CSV): Optional. Output values per step (default: stdout).

Modes

  • IO mode (default): Reads input variables from CSV for each step, writes output variables for each step.
  • Continuous compute mode: Runs for a set number of steps without input variables, outputs results at each step (CSV or text).

Example Input YAML

Below is an example of a GNPS system description in YAML format (from test_math_functions.yaml):

description: "A test system"

cells:
  - id: 1
    contents:
      - x = 0, y = 0, E = 0, z = 0, u = 1
      # Comments can be added like this
    # input variables should be empty for continuous compute mode
    input: [u] 
    output: [x,y,z]

rules:
  - E > x | x + 3 -> x  # guarded rule
  - E + 1 -> E         # unguarded rule
  - 0*z + x + y -> z
  - (E > u || E > x || E > y) | u + x + y -> y                                   # step will be reset to 0

For more details, see the CHANGELOG.md and documentation in the docs/ folder.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gnps-0.1.2.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gnps-0.1.2-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file gnps-0.1.2.tar.gz.

File metadata

  • Download URL: gnps-0.1.2.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.9 CPython/3.12.11 Linux/6.1.0-40-amd64

File hashes

Hashes for gnps-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e3539659617bfd3e7e7967f4b40d35e2b98875b6aaeca743f14aa8347b3cf3e2
MD5 9c8a7d82a0d9cf05207b0ed0e759d610
BLAKE2b-256 24e3853937c8496c8c3581da3772ecd3c0bd6e9e3fbed96207e54b60c01a81fb

See more details on using hashes here.

File details

Details for the file gnps-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: gnps-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.9 CPython/3.12.11 Linux/6.1.0-40-amd64

File hashes

Hashes for gnps-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d26ce2dd04b1b24024692c48702add14828aba56d2062422fcc150497d93d75
MD5 8d2f7963aa188a77fb12a4316e80f549
BLAKE2b-256 56a3fd0c3831c0bc6c7ae5ce3d70c361f7a52e66851e25f8aef2523844fe9fb1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page