Skip to content

Commit c4ad01f

Browse files
committed
initiated graph based generator
1 parent 7fc3bdb commit c4ad01f

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

junctionart/roadgen/graph/Graph.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from typing import List
2+
3+
class Node:
4+
def __init__(self, x, y):
5+
self.x = x
6+
self.y = y
7+
pass
8+
9+
10+
class Edge:
11+
def __init__(self, u: Node, v: Node, d:float = 0):
12+
self.u = u
13+
self.v = v
14+
self.d = d
15+
pass
16+
17+
18+
class Graph:
19+
def __init__(self, nodes:List[Node], edges:List[Edge]):
20+
self.nodes = nodes
21+
self.edges = edges
22+
pass
23+
24+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from roadgen.controlLine.ControlLineBasedGenerator import ControlLineBasedGenerator
2+
3+
class GraphBasedGenerator:
4+
5+
def __init__(self, debug=True, randomizeDistance=False, nLaneDistributionOnASide=[0.2, 0.7, 0.1, 0]):
6+
self.generator = ControlLineBasedGenerator((400, 400), debug=debug, seed=3, randomizeDistance=randomizeDistance, nLaneDistributionOnASide=nLaneDistributionOnASide)
7+
8+
9+
def generate(self, graph):
10+
pass
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from os.path import dirname, basename, isfile
2+
import glob
3+
modules = glob.glob(dirname(__file__)+"/*.py")
4+
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]

0 commit comments

Comments
 (0)