$darkmode
DENOPTIM
ConnectedLigand.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 org.openscience.cdk.interfaces.IAtom;
22
23import denoptim.constants.DENOPTIMConstants;
24import denoptim.graph.rings.RingClosingAttractor;
25
32public class ConnectedLigand
33{
34 //Root of the Ligand
35 private final IAtom seed;
36 //Connections
37 private final int connections;
38 //is dummy atom
39 private final boolean isDu;
40
41//------------------------------------------------------------------------------
42
43 public ConnectedLigand(IAtom seed, int connections)
44 {
45 this.seed = seed;
46 this.connections = connections;
47 String symbol = seed.getSymbol();
48 boolean isRCA = RingClosingAttractor.RCATYPEMAP.containsKey(symbol);
49 this.isDu = symbol.equals(DENOPTIMConstants.DUMMYATMSYMBOL) || isRCA ||
50 !DENOPTIMConstants.ALL_ELEMENTS.contains(symbol);
51 }
52
53//------------------------------------------------------------------------------
54
55 public int getConnections()
56 {
57 return this.connections;
58 }
59
60//------------------------------------------------------------------------------
61
62 public boolean isDummy()
63 {
64 return this.isDu;
65 }
66
67//------------------------------------------------------------------------------
68
69 public IAtom getAtom()
70 {
71 return this.seed;
72 }
73
74//------------------------------------------------------------------------------
75
76 public String toString()
77 {
78 return seed.getSymbol() + "(" + connections + "-conn.)";
79 }
80//------------------------------------------------------------------------------
81}
General set of constants used in DENOPTIM.
static final Set< String > ALL_ELEMENTS
static final String DUMMYATMSYMBOL
Symbol of dummy atom.
The RingClosingAttractor represent the available valence/connection that allows to close a ring.
static final Map< String, String > RCATYPEMAP
Recognized types of RingClosingAttractor and compatible types.
A ConnectedLigand is just an atom with an explicit field reporting the number of connected atoms.
ConnectedLigand(IAtom seed, int connections)