__author__ = 'Antonio Segura Cano'

import os
import re
import numpy as np

# We'll create a FSMachine class
# FSMachine class will generate all methods about the program
# A random FSMachine: FSMachine.random

#     KISS2 headers include the following information:
#
#     .i    # number of inputs
#     .o    # number of outputs
#     .p    # number of products
#     .s    # number of states used
#     .r    # RESET state [optional]


class FSMachine:
    """ FSMachine class """
    def __init__(self, n=10):
        """
        :param n: Number of Final State Machines that you want to create at the package (default: 10)
        :return: FSMachine package ready to work with it.
        """
        self.n = n

    def random(self, seed="seed", min=1, max=8, states=10):
        """
        :param seed: Introduce a seed to generate random FSMs (default: "seed")
        :param min: The minimum number of inputs or outputs in the FMS (included)
        :param max: The maximum number of inputs or outputs in the FMS (included)
        :param states:
        :return: A pack of random FSMs
        """
        np.random.seed(int(seed, 36))
        npri = np.random.random_integers
        for fsm in range(self.n):
            numinput = npri(min, max)