$darkmode
DENOPTIM
GraphEdit.java
Go to the documentation of this file.
1/*
2 * DENOPTIM
3 * Copyright (C) 2019 Marco Foscato <marco.foscato@uib.no>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package denoptim.utils;
20
21import java.util.LinkedHashMap;
22
23import denoptim.fragspace.FragmentSpace;
24import denoptim.graph.AttachmentPoint;
25import denoptim.graph.DGraph;
26import denoptim.graph.EdgeQuery;
27import denoptim.graph.Vertex.BBType;
28import denoptim.graph.VertexQuery;
29
30
37public class GraphEdit
38{
42 private EditTask task = null;
43
52 private VertexQuery vertexQuery = null;
53
58 private EdgeQuery edgeQuery = null;
59
64 private DGraph incomingGraph = null;
65
72 private Integer idAPOnIncomingGraph = null;
73
80 private int incomingBBId = -1;
81
89
96 private LinkedHashMap<Integer, Integer> incomingAPMap;
97
101 public static enum EditTask {
108
113
118 CHANGEVERTEX
120
121//------------------------------------------------------------------------------
122
123 public Integer getIncomingAPId()
124 {
125 return idAPOnIncomingGraph;
126 }
127
128//------------------------------------------------------------------------------
129
130 public void setAP(int apId)
131 {
132 this.idAPOnIncomingGraph = apId;
133 }
134
135//------------------------------------------------------------------------------
136
138 {
139 this.incomingGraph = incomingGraph;
140 }
141
142//------------------------------------------------------------------------------
143
145 {
146 return incomingGraph;
147 }
148
149//------------------------------------------------------------------------------
150
152 {
153 this.task = task;
154 }
155
156//------------------------------------------------------------------------------
157
159 {
160 return task;
161 }
162
163//------------------------------------------------------------------------------
164
166 {
167 return vertexQuery;
168 }
169
170//------------------------------------------------------------------------------
171
173 {
174 this.vertexQuery = vertexQuery;
175 }
176
177//------------------------------------------------------------------------------
178
180 {
181 this.edgeQuery = edgeQuery;
182 }
183
184//------------------------------------------------------------------------------
185
187 {
188 return edgeQuery;
189 }
190
191//------------------------------------------------------------------------------
192
193 public int getIncomingBBId()
194 {
195 return incomingBBId;
196 }
197
198//------------------------------------------------------------------------------
199
201 {
202 return incomingBBTyp;
203 }
204
205//------------------------------------------------------------------------------
206
207 public LinkedHashMap<Integer, Integer> getAPMappig()
208 {
209 return incomingAPMap;
210 }
211
212//------------------------------------------------------------------------------
213
214}
Container for the list of vertices and the edges that connect them.
Definition: DGraph.java:102
A query for edges: a list of properties that target edges should possess in order to match this query...
Definition: EdgeQuery.java:28
Query for searching vertices.
Definition of a graph editing task.
Definition: GraphEdit.java:38
LinkedHashMap< Integer, Integer > incomingAPMap
Mapping of AttachmentPoints between the current (first entry) and the incoming vertices (second entry...
Definition: GraphEdit.java:96
BBType incomingBBTyp
The type of the building block to use as incoming vertex when performing EditTask#CHANGEVERTEX.
Definition: GraphEdit.java:88
DGraph incomingGraph
The incoming graph for tasks that involve appending a subgraph onto another graph (when doing EditTas...
Definition: GraphEdit.java:64
VertexQuery vertexQuery
Query identifying the vertex that is the center of our attention when performing the graph editing ta...
Definition: GraphEdit.java:52
Integer idAPOnIncomingGraph
The identifier of the AttachmentPoint (AP) of the GraphEdit#incomingGraph when attaching such graph t...
Definition: GraphEdit.java:72
EditTask task
Type of editing task.
Definition: GraphEdit.java:42
GraphEdit(EditTask task)
Definition: GraphEdit.java:151
EdgeQuery edgeQuery
Query identifying the edge that is the center of our attention when performing the graph editing task...
Definition: GraphEdit.java:58
void setEdgeQuery(EdgeQuery edgeQuery)
Definition: GraphEdit.java:179
void setAP(int apId)
Definition: GraphEdit.java:130
LinkedHashMap< Integer, Integer > getAPMappig()
Definition: GraphEdit.java:207
void setVertexQuery(VertexQuery vertexQuery)
Definition: GraphEdit.java:172
VertexQuery getVertexQuery()
Definition: GraphEdit.java:165
int incomingBBId
Index of the building block to use as incoming vertex when performing EditTask#CHANGEVERTEX.
Definition: GraphEdit.java:80
void setIncomingGraph(DGraph incomingGraph)
Definition: GraphEdit.java:137
The type of building block.
Definition: Vertex.java:86
Defined the kind of graph editing task.
Definition: GraphEdit.java:101
DELETEVERTEX
Removes any matching vertex.
Definition: GraphEdit.java:112
REPLACECHILD
Replaces any child (or tree of children) of any vertex matching the vertex query with a given incomin...
Definition: GraphEdit.java:107