-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathP2.py
More file actions
28 lines (23 loc) · 689 Bytes
/
P2.py
File metadata and controls
28 lines (23 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from typing import List
from Graph import Graph
from Production import Production
from Vertex import Vertex
class P2(Production):
@staticmethod
def get_vertices_number() -> int:
return 2
@staticmethod
def apply(vertices: List[Vertex], graph: Graph):
from_vertex = vertices[0]
to_vertex = vertices[1]
edge = graph.edges[(from_vertex.index, to_vertex.index)]
graph.remove_edge(edge)
@staticmethod
def description() -> str:
return ('name: P2\n'
'L: ( ) -----> ( )\n'
'P: ( ) ( )\n'
'c: {CopyRest}\n')
@staticmethod
def to_string():
return "P2"