Skip to content
Snippets Groups Projects
Commit 5a065db9 authored by Lukas Kettenbach's avatar Lukas Kettenbach
Browse files

Initialized alternative approach..

parent 1ef19faa
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ import unittest
from core.BayesNet import BayesNet
from core.Node import Node
class NodeAddAndRemoveTestCase(unittest.TestCase):
def setUp(self):
self.bn = BayesNet()
......@@ -13,10 +14,10 @@ class NodeAddAndRemoveTestCase(unittest.TestCase):
def test_add(self):
n = Node("Some Node")
self.bn.add_node(n)
self.assertEqual(n,self.bn.get_node("Some Node"))
self.assertEqual(n, self.bn.get_node("Some Node"))
self.assertTrue(n in self.bn.get_nodes(["Some Node"]))
node_with_same_name=Node("Some Node")
node_with_same_name = Node("Some Node")
self.assertRaises(Exception, self.bn.add_node, node_with_same_name)
def test_remove(self):
......@@ -24,7 +25,6 @@ class NodeAddAndRemoveTestCase(unittest.TestCase):
self.bn.add_node(n)
self.bn.remove_node(n)
self.assertFalse(n in self.bn.get_nodes())
#include this so you can run this test without nose
......
# -*- coding: utf-8 -*-
class AbstractCPD(object):
'''TODO: write doc'''
def __init__(self):
super(AbstractCPD, self).__init__()
\ No newline at end of file
# -*- coding: utf-8 -*-
from reasoning.AbstractCPD import AbstractCPD
class CPT(AbstractCPD):
'''TODO: write doc'''
def __init__(self):
super(CPT, self).__init__()
# -*- coding: utf-8 -*-
from reasoning.AbstractCPD import AbstractCPD
class Gauss(AbstractCPD):
'''TODO: write doc'''
def __init__(self):
super(Gauss, self).__init__()
# -*- coding: utf-8 -*-
from core.Node import Node
from reasoning.AbstractCPD import AbstractCPD
from reasoning.CPD import CPD
class RandomNode(Node):
class AbstractRandomNode(Node):
'''TODO: write doc'''
cpd = AbstractCPD()
cpd = CPD()
def __init__(self):
super(RandomNode, self).__init__()
\ No newline at end of file
super(AbstractRandomNode, self).__init__()
\ No newline at end of file
from AbstractCPD import AbstractCPD
from CPT import CPT
from Gauss import Gauss
from RandomNode import RandomNode
from DiscreteNode import DiscreteNode
from GaussNode import GaussNode
from RandomNode import AbstractRandomNode
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment