code
stringlengths
1
1.72M
language
stringclasses
1 value
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python from distutils.core import setup, Extension import os ## Windows (32), Python 2.6, with GCC (MinGW or Cygwin) Only, for now if os.name == "nt": ## Constants library_dirs = [os.path.abspath('lib/win32')] include_dirs = [os.path.abspath('ext/include'), os.path.abspath(os.path....
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python """Unit Tests for fmath.py""" import unittest import flamingo.fmath as fmath import math import pickle from numbers import Number class TestPow(unittest.TestCase): def setUp(self): self.data = [2, 3, 4, 7, 17, 710, 483, 60495, 712345] self.bad = ["hello world!",...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## fl - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at yo...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## fl - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at yo...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python """Unit Tests for fmath.py""" import unittest import flamingo.fmath as fmath import math import pickle from numbers import Number class TestPow(unittest.TestCase): def setUp(self): self.data = [2, 3, 4, 7, 17, 710, 483, 60495, 712345] self.bad = ["hello world!",...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
#!/usr/bin/env python from distutils.core import setup, Extension import os ## Windows (32), Python 2.6, with GCC (MinGW or Cygwin) Only, for now if os.name == "nt": ## Constants library_dirs = [os.path.abspath('lib/win32')] include_dirs = [os.path.abspath('ext/include'), os.path.abspath(os.path....
Python
#!/usr/bin/env python ## flamingo - 2D Game Engine ## Copyright (C) 2009 Bradley Zeis ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## ...
Python
from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app import os import urllib import urllib2 from google.appengine.api import users from google.appengine.api import urlfetch from google.appengine.ext.webapp import template from google.appengine.ext import db clas...
Python
#!/usr/bin/env python from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha...
Python
#!/usr/bin/env python from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha...
Python
from django.conf.urls.defaults import * urlpatterns = patterns('', # Example: # (r'^poicreator/', include('poicreator.foo.urls')), # Uncomment this for admin: # (r'^admin/', include('django.contrib.admin.urls')), )
Python
#!/usr/bin/env python # Copyright (C) 2012 Sebastien MACKE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2, as published by the # Free Software Foundation # # This program is distributed in the hope that it will be useful, but WI...
Python
""" Example job for the process pool """ import datetime from twisted.application.service import IServiceMaker from twisted.application import internet from twisted.plugin import IPlugin from twisted.python import usage from zope.interface import implements from fjork import ifjork from fjork import protocols class...
Python
""" Example job for the process pool """ from twisted.application.service import IServiceMaker #from twisted.application import internet from twisted.plugin import IPlugin from twisted.python import usage from zope.interface import implements from fjork import ifjork #from fjork import pool #from fjork import protoco...
Python
""" Example job for the process pool """ import datetime from twisted.application.service import IServiceMaker from twisted.application import internet from twisted.plugin import IPlugin from twisted.python import usage from zope.interface import implements from fjork import ifjork from fjork import protocols class...
Python
#-*- test-case-name: fjork.test.test_settings -*- """ The settings.py module loads a yaml/json document which is used as a configuration file for the fjork service. Between the ---- markers is an example of a valid yaml file: ----------------------------------- # this is a comment host: localhost port: 8483 webware...
Python
import collections from timeit import default_timer from twisted.python import log from fjork import settings def logFunctionTime(function): if settings.DEBUG: def timedFunction(*args, **kwargs): start = default_timer() result = function(*args, **kwargs) end = defaul...
Python
#-*- test-case-name: fjork.test.test_server -*- """ Defines the Fjork Server """ from twisted.application import internet, service from twisted.internet import defer, reactor from twisted.python import log from twisted.web import server from fjork import pool from fjork import settings from fjork.web import Root cl...
Python
# __init__.py
Python
# __init__.py
Python
#-*- test-case-name: fjork.test.test_pool -*- """pool.py Queues and runs requests through the pool """ import os from twisted.internet import defer from twisted.internet import error, reactor from twisted.python import log from zope import interface from fjork import ifjork from fjork import protocols from fjork i...
Python
#-*- test-case-name: fjork.test.test_web -*- #import urlparse #import simplejson as json from twisted.python import log from twisted.internet import defer from twisted.web import http, resource, server, static from twisted.web import proxy from fjork import settings from fjork import utils staticResource = static.F...
Python
""" Defines Fjork interfaces """ from zope import interface class IFjorkClientProtocol(interface.Interface): """ Basic line receiver that handles a few simple messages """ class IFjorkClientFactory(interface.Interface): """ """ class IFjorkServerProtocol(interface.Interface): """ ...
Python
""" """ import marshal import cStringIO import struct import simplejson from twisted.internet import protocol from twisted.python import log from zope import interface from fjork import ifjork class FjorkClientProtocol(protocol.Protocol): """Fjork clients are basically just line receivers that handle severa...
Python
# __init__.py
Python
#!/usr/bin/env python import sys class fabrica_t: def __init__(self, id, esquina, horario_apertura, horario_cierre): self.id = id self.esquina = esquina self.horario_apertura = horario_apertura self.horario_cierre = horario_cierre self.juguetes = [] def agregarJuguete(self, j): self.juguetes.append(...
Python
#!/usr/bin/env python import sys import heapq from prueba import * def hacer_algo(var): if(var == True): print "Es Verdad" else: return print "TERMINE" fabrica_1 = fabrica_t("2580","14","0","30") fabrica_2 = fabrica_t("2581","2562","27","75") """ if(fabrica_1 > fabrica_2): print "fabrica 1 es mayor" el...
Python
#!/usr/bin/env python import sys from juguete import * class fabrica_t: def __init__(self, id, esquina, horario_apertura, horario_cierre): self.id = id self.esquina = esquina self.horario_apertura = horario_apertura self.horario_cierre = horario_cierre self.juguetes = [] def insertarJuguete(self, id, ...
Python
#!/usr/bin/env python import sys import heapq import math from mapa import * def darFormatoHora(n): horas = n/60 minutos = n - (horas * 60) if(horas < 10): h = "0{0}".format(horas) else: h = "{0}".format(horas) if(minutos < 10): m = "0{0}".format(minutos) else: m = "{0}".format(minutos) retur...
Python
#!/usr/bin/env python import sys import heapq import math from gestor import * """ ********************************************************* UTILS ********************************************************* """ def obtenerComandoConParams(texto): partes = texto.split(' ') return partes def obtenerParams(tex...
Python
#!/usr/bin/env python class juguete_t: def __init__(self, id, valor, peso): self.id = id self.valor = valor self.peso = peso
Python
#!/usr/bin/env python from grafo import * from fabrica import * class gestor_t: def __init__(self): self.grafo = grafo_t() self.fabricas = [] self.fabricas_lista = [] self.capacidadTrineo = 0 self.lista_optima = [] def definirCapacidadTrineo(self, capacidad): # Convierto el valor a int self.capac...
Python
#!/usr/bin/env python import sys from fabrica import * class heap_t: def __init__(self): self.vector = [] self.cant = 0 def comparar(self, a, b): if(a == None): return 1 if(b == None): return -1 if(a.horario_cierre < b.horario_cierre): return 1 elif(a.horario_cierre > b.horario_ci...
Python
#!/usr/bin/env python class vertice_t: def __init__(self, id, x, y, latitud, longitud): self.id = id self.x = x self.y = y self.latitud = latitud self.longitud = longitud self.vecinos = [] def agregarVecino(self, v): if(v in self.vecinos): return self.vecinos.append(v)
Python
#!/usr/bin/env python import sys import heapq import math from mapa import * def darFormatoHora(n): horas = n/60 minutos = n - (horas * 60) if(horas < 10): h = "0{0}".format(horas) else: h = "{0}".format(horas) if(minutos < 10): m = "0{0}".format(minutos) else: m = "{0}".format(minutos) retur...
Python
#!/usr/bin/env python import sys import heapq import math from gestor import * """ ********************************************************* UTILS ********************************************************* """ def obtenerComandoConParams(texto): partes = texto.split(' ') return partes def obtenerParams(tex...
Python
#!/usr/bin/env python import sys import heapq from prueba import * def hacer_algo(var): if(var == True): print "Es Verdad" else: return print "TERMINE" fabrica_1 = fabrica_t("2580","14","0","30") fabrica_2 = fabrica_t("2581","2562","27","75") """ if(fabrica_1 > fabrica_2): print "fabrica 1 es mayor" el...
Python
#!/usr/bin/env python from grafo import * from fabrica import * class gestor_t: def __init__(self): self.grafo = grafo_t() self.fabricas = [] self.fabricas_lista = [] self.capacidadTrineo = 0 self.lista_optima = [] def definirCapacidadTrineo(self, capacidad): # Convierto el valor a int self.capac...
Python
#!/usr/bin/env python import sys class fabrica_t: def __init__(self, id, esquina, horario_apertura, horario_cierre): self.id = id self.esquina = esquina self.horario_apertura = horario_apertura self.horario_cierre = horario_cierre self.juguetes = [] def agregarJuguete(self, j): self.juguetes.append(...
Python
#!/usr/bin/env python import sys from fabrica import * class heap_t: def __init__(self): self.vector = [] self.cant = 0 def comparar(self, a, b): if(a == None): return 1 if(b == None): return -1 if(a.horario_cierre < b.horario_cierre): return 1 elif(a.horario_cierre > b.horario_ci...
Python
#!/usr/bin/env python import sys from juguete import * class fabrica_t: def __init__(self, id, esquina, horario_apertura, horario_cierre): self.id = id self.esquina = esquina self.horario_apertura = horario_apertura self.horario_cierre = horario_cierre self.juguetes = [] def insertarJuguete(self, id, ...
Python
#!/usr/bin/env python class juguete_t: def __init__(self, id, valor, peso): self.id = id self.valor = valor self.peso = peso
Python
#!/usr/bin/env python class vertice_t: def __init__(self, id, x, y, latitud, longitud): self.id = id self.x = x self.y = y self.latitud = latitud self.longitud = longitud self.vecinos = [] def agregarVecino(self, v): if(v in self.vecinos): return self.vecinos.append(v)
Python
#!/usr/bin/env python import cgi import urllib import webapp2 import jinja2 import os from google.appengine.ext import db from google.appengine.api import users jinja_environment = jinja2.Environment( loader = jinja2.FileSystemLoader(os.path.dirname(__file__)) ) MAX_NEW_CARDS = 10 class Card(db.Model): """Model...
Python
__author__ = 'skird' from algo.shortestpathfinder import ShortestPathFinder class TransportScheduleGraph: def __init__(self, vertices_list): """ :param vertices_list - list of vertices of graph """ self.__finder = ShortestPathFinder(vertices_list) @staticmethod def __appe...
Python
__author__ = 'skird' class Dijkstra: @staticmethod def find_shortest_paths(graph, from_vertices, *, initial_path_weight=0, comparator=lambda w1, w2: w1 < w2, append_edge=lambda path, edge: path + edge[1], ...
Python
from algo.dijkstra import Dijkstra __author__ = 'skird' class ShortestPathFinder: def __init__(self, vertices_list): """ TODO: doc """ self.__comparator = lambda w1, w2: w1 < w2 self.__appender = lambda path, edge: path + edge[1] self.__get_destination = lambda edg...
Python
__author__ = 'skird' import unittest from algo.shortestpathfinder import ShortestPathFinder class ShortestPathFinderIntegration(unittest.TestCase): def setUp(self): pass def test_on_simple_graph(self): finder = ShortestPathFinder(['a', 'b', 'c', 'd']) finder.add_edge('a', ('b', 5)) ...
Python
__author__ = 'skird' import unittest from algo.transport_scheduling import TransportScheduleGraph class TransportSchedulingIntegrationTest(unittest.TestCase): def test_simple_graphs(self): graph = TransportScheduleGraph(['Sheremetievo', 'Dolgoprudnaya', 'Novodachnaya', ...
Python
__author__ = 'skird'
Python
__author__ = 'skird' from algo.dijkstra import Dijkstra import itertools import unittest import random class DijkstraIntegrationTest(unittest.TestCase): def setUp(self): pass def __make_weighted_list_graph(self, n, edges) -> list: graph = [list() for _ in range(n)] for edge in edges...
Python
__author__ = 'Алексей' from dijkstra import Dijkstra class PublicTransport: class Edge: def __init__(self, time_depart, to_vertex, time_arrive): self.time_depart = time_depart self.time_arrive = time_arrive self.destination = to_vertex def __init__(self, graphSize...
Python
__author__ = 'Алексей' import heapq class Dijkstra: def __vertex_element_generator__(self, cmp): class DijkstraVertex: def __init__(self, vertex, path): self.vertex = vertex self.path = path def __lt__(self, other): return cmp(self.p...
Python
__author__ = 'Алексей' from unittest import TestCase from dijkstra import Dijkstra from floyd import Floyd import random import copy class Edge: def __init__(self, destination, weight): self.destination = destination self.weight = weight class BaseReleaseIntegrationTests(TestCase): def test...
Python
__author__ = 'Алексей' def Floyd(matrix, size, operation = lambda a, b: a + b, cmp = lambda w1, w2: w1 < w2): """ Floyd algorithm to find shortest paths in graph Complexity O(V ^ 3), where V is number of vertices in graph :param matrix: adjacency matrix of graph. matrix[i][j] - weigh...
Python