#!/usr/bin/env python

import random
import math
import time
import copy
from pprint import pprint as pp
from .objectfns import MAPSB

import sim

debug = False

#   Print the modules being used for the external simulator
if debug:
    using_modules = [sim.circuit, sim.devices, sim.printing]
    using_modules = ["%s %s" % (m.__name__, m.__version__) for m in using_modules]
    print "Using:\n    %s" % '\n    '.join(using_modules)

class Component(object):
    def __init__(self, part_id=None, n1=None, n2=None, value=None):
        self.value      = value
        self.part_id    = part_id
        self.n1         = n1
        self.n2         = n2

    def __repr__(self):
        return '<%s.%s object at %s> %s %s %s %s' % (
            self.__class__.__module__,
            self.__class__.__name__,
            hex(id(self)),
            self.part_id,
            self.n1,
            self.n2,