21import java.util.ArrayList;
23import java.util.logging.Logger;
25import org.openscience.cdk.AtomContainer;
26import org.openscience.cdk.interfaces.IAtomContainer;
28import com.google.gson.Gson;
30import denoptim.constants.DENOPTIMConstants;
31import denoptim.json.DENOPTIMgson;
32import denoptim.utils.GraphUtils;
33import denoptim.utils.MutationType;
34import denoptim.utils.Randomizer;
49 private List<AttachmentPoint>
lstAPs;
65 lstAPs =
new ArrayList<AttachmentPoint>();
66 lstSymAPs =
new ArrayList<SymmetricAPs>();
81 lstAPs =
new ArrayList<AttachmentPoint>();
82 lstSymAPs =
new ArrayList<SymmetricAPs>();
98 lstAPs =
new ArrayList<AttachmentPoint>();
99 lstSymAPs =
new ArrayList<SymmetricAPs>();
159 if (symmetricSet.contains(ap))
183 ArrayList<Integer> lstAvailableAP =
new ArrayList<>();
184 for (
int i=0; i<
lstAPs.size(); i++)
186 if (
lstAPs.get(i).isAvailable())
187 lstAvailableAP.add(i);
189 return lstAvailableAP;
198 if (denoptimAttachmentPoint.isAvailable())
209 if (denoptimAttachmentPoint.isAvailable())
270 cAp.
setID(ap.getID());
274 List<SymmetricAPs> cLstSymAPs =
new ArrayList<SymmetricAPs>();
280 cSymAPs.
add(c.
getAP(ap.getIndexInOwner()));
282 cLstSymAPs.add(cSymAPs);
371 IAtomContainer iac =
new AtomContainer();
388 Randomizer rng,
boolean removeUsedRCAs,
boolean rebuild)
404 String jsonOutput = gson.toJson(
this);
436 ArrayList<APClass> lst =
new ArrayList<APClass>();
439 APClass apCls = ap.getAPClass();
440 if (!lst.contains(apCls))
453 this.lstSymAPs = sAPs;
461 if (this.lstSymAPs==
null)
463 this.lstSymAPs =
new ArrayList<SymmetricAPs>();
465 this.lstSymAPs.add(symAPs);
489 List<Vertex> lst =
new ArrayList<Vertex>();
General set of constants used in DENOPTIM.
static final String VERTEXJSONTAG
SDF tag containing vertex encoding in JSON format.
static final String APSTAG
SDF tag defining attachment points.
An attachment point (AP) is a possibility to attach a Vertex onto the vertex holding the AP (i....
void setID(int id)
Sets the unique integer that is used to sort list of attachment points.
An empty vertex has the behaviors of a vertex, but has no molecular structure.
static EmptyVertex fromJson(String json)
Reads a JSON string and returns an instance of this class.
List< AttachmentPoint > lstAPs
Attachment points on this vertex.
List< SymmetricAPs > getSymmetricAP()
SymmetricAPs getSymmetricAPs(AttachmentPoint ap)
For the given attachment point index locate the symmetric partners i.e.
void addSymmetricAPSet(SymmetricAPs symAPs)
IAtomContainer getIAtomContainer()
Although empty vertex do not contain atoms, by definitions, we allow the generation of an SDF represe...
ArrayList< Integer > getFreeAPList()
IAtomContainer getIAtomContainer(Logger logger, Randomizer rng, boolean removeUsedRCAs, boolean rebuild)
Although empty vertex do not contain atoms, by definitions, we allow the generation of an SDF represe...
List< SymmetricAPs > lstSymAPs
List of AP sets that are related to each other, so that we call them "symmetric" (though symmetry is ...
EmptyVertex(BBType type)
Constructor for an identified vertex without attachment points.
boolean sameAs(EmptyVertex other, StringBuilder reason)
Compares this and another vertex ignoring vertex IDs.
EmptyVertex clone()
Returns a deep-copy of this vertex.
void addAP(APClass apClass)
Adds an attachment point with the specified APClass.
EmptyVertex(long id)
Constructor for an identified vertex without attachment points.
EmptyVertex()
Constructor for an empty vertex.
ArrayList< APClass > getAllAPClasses()
Returns the list of all APClasses on present on this fragment.
void setSymmetricAP(List< SymmetricAPs > sAPs)
void setSymmetricAPSets(List< SymmetricAPs > sAPs)
String toJson()
Produces a string that represents this vertex and that adheres to the JSON format.
List< SymmetricAPs > getSymmetricAPSets()
String toString()
Produces a human readable, short string to represent the vertex by its vertex ID, building block ID (...
List< Vertex > getMutationSites(List< MutationType > ignoredTypes)
A list of mutation sites from within this vertex.
List< AttachmentPoint > getAttachmentPoints()
EmptyVertex(long id, ArrayList< AttachmentPoint > lstAPs, ArrayList< SymmetricAPs > lstSymAPs, boolean isRCV)
Constructor for an identified vertex.
void addAP()
Adds an attachment point with no APClass or other attribute.
A collection of AttachmentPoints that are related by a relation that we call "symmetry",...
boolean add(T item)
Adds an item to this list, if not already present.
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
Set< String > uniquefyingPropertyKeys
List of properties required to make Vertex#sameAs(Vertex, StringBuilder) method return false when pro...
Map< Object, Object > properties
Map of customizable properties.
void setMutationTypes(List< MutationType > lst)
List< MutationType > getMutationTypes()
Returns the list of mutation types.
void setProperties(Map< Object, Object > properties)
int getBuildingBlockId()
Returns the index of the building block that should correspond to the position of the building block ...
Vertex.BBType getBuildingBlockType()
List< MutationType > getUnfilteredMutationTypes()
Returns the mutation types that are constitutionally configures for this vertex irrespectively on the...
void setAsRCV(boolean isRCV)
Map< Object, Object > copyStringBasedProperties()
Copies all the string-based properties and properties defined in the Vertex#uniquefyingPropertyKeys s...
boolean sameVertexFeatures(Vertex other, StringBuilder reason)
Compares this and another vertex ignoring vertex IDs.
void setBuildingBlockId(int buildingBlockId)
void setBuildingBlockType(Vertex.BBType buildingBlockType)
AttachmentPoint getAP(int i)
Get attachment point i on this vertex.
Class for de/serializing DENOPTIM graphs from/to JSON format.
static synchronized long getUniqueVertexIndex()
Unique counter for the number of graph vertices generated.
Tool to generate random numbers and random decisions.
The type of building block.
Flag declaring the type of Vertex implementation.