Example #1
0
 def setup_xmlrpc_plotserver(self):
     """
     Sets up the server for real-time chain watch
     """
     p = 0
     p2 = 0
     while p == 0 or p2 == 0:
         p = rpc_plot()
         p2 = rpc_plot(hold=1)
     self.pserver = xmlrpclib.ServerProxy("http://localhost:%s" % p)
     self.pserver2 = xmlrpclib.ServerProxy("http://localhost:%s" % p2)
Example #2
0
 def setup_xmlrpc_plotserver(self):
     """
     Sets up the server for real-time chain watch
     """
     p = 0
     p2 = 0
     while p == 0 or p2 == 0:
         p = rpc_plot()
         p2 = rpc_plot(hold=1)
     self.pserver = six.moves.xmlrpc_client.ServerProxy(
         'http://localhost:%s' % p)
     self.pserver2 = six.moves.xmlrpc_client.ServerProxy(
         'http://localhost:%s' % p2)
Example #3
0
 def __init__(self):
     self.historico = defaultdict(lambda: {
         "comida": [],
         "reputacao": [],
         "cacou": 0,
         "descansou": 0
     })
     self.jogadores = None  # dicionario com as instancias dos jogadores;
     self.recompensa = []
     self.cemiterio = {}
     self.rodada = 0
     self.bugados = {}
     self.M = []  #série de m
     self.comida_plot = xmlrpc.client.ServerProxy(
         'http://localhost:{}'.format(rpc_plot(persist=1)))
     self.recompensa_plot = xmlrpc.client.ServerProxy(
         'http://localhost:{}'.format(rpc_plot(persist=1)))
Example #4
0
 def __init__(self):
     self.historico = defaultdict(lambda: {"comida": [], "reputacao": [], "cacou": 0, "descansou": 0})
     self.jogadores = None # dicionario com as instancias dos jogadores;
     self.recompensa = []
     self.cemiterio = {}
     self.rodada = 0
     self.bugados = {}
     self.M = [] #série de m
     self.comida_plot = xmlrpc.client.ServerProxy('http://localhost:{}'.format(rpc_plot(persist=1)))
     self.recompensa_plot = xmlrpc.client.ServerProxy('http://localhost:{}'.format(rpc_plot(persist=1)))
 def setUp(self):
     port = rpc_plot(persist=0)
     self.r_tplot = six.moves.xmlrpc_client.ServerProxy(
         'http://localhost:%s' % port)
 def test___init__(self):
     port = rpc_plot(persist=0)
     assert isinstance(port, int)
Example #7
0
 def setUp(self):
     port = rpc_plot(persist=0)
     self.r_tplot = six.moves.xmlrpc_client.ServerProxy('http://localhost:%s'%port)
Example #8
0
 def test___init__(self):
     port = rpc_plot(persist=0)
     assert isinstance(port, int)
#
# Created:     2008-11-26
# Copyright:   (c) 2008 by the Author
# Licence:     GPL
#-----------------------------------------------------------------------------
__docformat__ = "restructuredtext en"
from numpy.random import uniform, multinomial, exponential, random
from numpy import arange, array, empty, zeros, log, isnan, nanmax, nan_to_num, ceil
import time
import six.moves.xmlrpc_client
import pdb
import copy
from multiprocessing import Pool
try:
    from liveplots import xmlrpcserver as xmlrpc
    port = xmlrpc.rpc_plot(persist=0)
    server = six.moves.xmlrpc_client.ServerProxy('http://localhost:%s' % port,
                                                 allow_none=True)
    viz = True
except:
    print("faiô...")
    viz = False


def dispatch(model):
    '''this function is necessary for paralelization'''
    #~ model.server = server
    return model.GSSA()


class Model: