Skip to content

PiContactDetectionDescriptor doesn't work correctly #509

@k-ujihara

Description

@k-ujihara

I consider that PiContactDetectionDescriptor does not work correctly. For example, the following test137 is failed.
Anyway, I could not find the specification.

@Before
public void setUp() throws Exception {
    setDescriptor(PiContactDetectionDescriptor.class);
}

@Test
public void testButadiene() {
    IAtomContainer mol = TestMoleculeFactory.makeAlkane(4);
    mol.getBond(0).setOrder(IBond.Order.DOUBLE);
    mol.getBond(2).setOrder(IBond.Order.DOUBLE);
    for (int i = 0; i < 4; i++) 
        for (int j = 0; j < 4; j++) 
            Assert.assertEquals(true, checkAtomAtom(mol, i, j));
}
    
@Test
public void test137() {
    IAtomContainer mol = TestMoleculeFactory.makeAlkane(8);
    mol.getBond(0).setOrder(IBond.Order.DOUBLE);
    mol.getBond(2).setOrder(IBond.Order.DOUBLE);
    mol.getBond(6).setOrder(IBond.Order.DOUBLE);        
    for (int i = 0; i < 4; i++) 
        for (int j = 0; j < 4; j++) 
            Assert.assertEquals(true, checkAtomAtom(mol, i, j));
    for (int i = 0; i < 4; i++) 
        for (int j = 4; j < 8; j++) 
            Assert.assertEquals(false, checkAtomAtom(mol, i, j));
    Assert.assertEquals(true, checkAtomAtom(mol, 6, 7));
}

private boolean checkAtomAtom(IAtomContainer mol, int i, int j) {
    DescriptorValue result = descriptor.calculate(mol.getAtom(i), mol.getAtom(j), mol);
    BooleanResult val = (BooleanResult)result.getValue();
    return val.booleanValue();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions