# Path: ndlib/models/compartments/enums/NumericalType.py
# class NumericalType(Enum):
#     STATUS = 0
#     ATTRIBUTE = 1
# 
# Path: ndlib/models/compartments/enums/SAType.py
# class SAType(Enum):
#     MEAN = 0
#     VARIANCE = 1
#     MIN = 2
#     MAX = 3


import unittest
import os
import networkx as nx
import numpy as np
import ndlib.models.ModelConfig as mc
import ndlib.models.ContinuousModel as gc
import ndlib.models.ContinuousModelRunner as gcr
import ndlib.models.compartments as cpm
from ndlib.models.compartments.enums.NumericalType import NumericalType
from ndlib.models.compartments.enums.SAType import SAType

        def update_2(node, graph, status, attributes, constants):
            return status[node]['status_1'] + 0.5

        # Rules
        model.add_rule('status_1', update_1, condition)
        model.add_rule('status_2', update_2, condition)

        config = mc.Configuration()
        model.set_initial_status(initial_status, config)

        # Simulation
        runner = gcr.ContinuousModelRunner(model, config)
        results = runner.run(2, [1], [initial_status])
        self.assertEqual(len(results), 2)

    def test_runner_sa(self):
        g = nx.erdos_renyi_graph(n=10, p=0.5)

        constants = {
            'constant_1': 0.5,
            'constant_2': 0.8
        }

        def initial_status_1(node, graph, status, constants):
            return np.random.uniform(0, 0.5)

        def initial_status_2(node, graph, status, constants):
            return status['status_1'] + np.random.uniform(0.5, 1)


# Path: ndlib/models/compartments/enums/NumericalType.py
# class NumericalType(Enum):
#     STATUS = 0
#     ATTRIBUTE = 1
# 
# Path: ndlib/models/compartments/enums/SAType.py
# class SAType(Enum):
#     MEAN = 0
#     VARIANCE = 1
#     MIN = 2
#     MAX = 3


# Path: ndlib/test/test_continuous_model.py
import unittest
import os
import networkx as nx
import numpy as np
import ndlib.models.ModelConfig as mc
import ndlib.models.ContinuousModel as gc
import ndlib.models.ContinuousModelRunner as gcr
import ndlib.models.compartments as cpm
from ndlib.models.compartments.enums.NumericalType import NumericalType
from ndlib.models.compartments.enums.SAType import SAType


        def update_2(node, graph, status, attributes, constants):
            return status[node]['status_1'] + 0.5

        # Rules
        model.add_rule('status_1', update_1, condition)
        model.add_rule('status_2', update_2, condition)

        config = mc.Configuration()
        model.set_initial_status(initial_status, config)

        # Simulation
        runner = gcr.ContinuousModelRunner(model, config)
        results = runner.run(2, [1], [initial_status])
        self.assertEqual(len(results), 2)

    def test_runner_sa(self):
        g = nx.erdos_renyi_graph(n=10, p=0.5)

        constants = {
            'constant_1': 0.5,
            'constant_2': 0.8
        }

        def initial_status_1(node, graph, status, constants):
            return np.random.uniform(0, 0.5)

        def initial_status_2(node, graph, status, constants):
            return status['status_1'] + np.random.uniform(0.5, 1)


        initial_status = {