Ejemplo n.º 1
0
    def testBounce(self):
        a = main.Agent()
        w = main.Wall()
        w.p1 = (0, 100)
        w.p2 = (100, 100)

        d_new = w.bounce_direction(a)
        self.assertTrue(d_new >= 0.0 and d_new <= 360.0)
Ejemplo n.º 2
0
def test_agent():
    '''
    Testing main class Agent.
    :return: None
    '''
    agent = main.Agent()
    agent.add_property()
    agent.display_properties()
    agent.assets()
    agent.taxes_percentage()
Ejemplo n.º 3
0
    def testCollides(self):
        a = main.Agent()
        w = main.Wall()
        w.p1 = (0, 100)
        w.p2 = (100, 100)

        self.assertFalse(w.collides(a))

        a.position = (50, 97)

        self.assertTrue(w.collides(a))

        a.position = (120, 97)

        self.assertFalse(w.collides(a))
Ejemplo n.º 4
0
def starting():
    util = main.Utility()
    mandate_list = ["monomandatario", "plurimandatario"]
    print "Welcome, initializing data"
    print "Insert your name and type of mandate."
    print "What's your name?"
    agent_name = raw_input(">>>")
    print "Type of mandate?"
    mandate = raw_input(">>>")
    if util.check_answer(mandate, mandate_list) is not True:
        print "Only \'monomandatario\' and \'plurimandatario\' are accetable"
        starting()
    else:
        print "%s and %s, it's all correct?" % (agent_name, mandate)
        current_answer = raw_input("y/n >>>")
        if util.check_answer(current_answer, util.yes_list):
            agent = main.Agent(agent_name, mandate)
            print agent.name, agent.mandate, "all ok"
            db = main.Database()
            db.check_existing_db()
            db.insert_data(agent.name, agent.mandate)
        else:
            print "type your name again"
            starting()
Ejemplo n.º 5
0
def check_agent():
    agent = main.Agent()
    agent.add_property()
    agent.display_properties()
Ejemplo n.º 6
0
import sys
import main



agente = main.Agent(sys.argv[1],sys.argv[2])
fattura = main.Invoice(sys.argv[3], sys.argv[4], sys.argv[5])
print agente.name, agente.mandate
print fattura.date, fattura.number, fattura.net_value
par = main.Parameters()
par.loader(par.config_file_path)
calcolatore = main.Algorithms()
calcolatore.calc_enasarco(fattura.net_value, par.rate)

print calcolatore.result