当前位置: 首页>>代码示例>>C#>>正文


C# IAtomContainer.getMaximumBondOrder方法代码示例

本文整理汇总了C#中IAtomContainer.getMaximumBondOrder方法的典型用法代码示例。如果您正苦于以下问题:C# IAtomContainer.getMaximumBondOrder方法的具体用法?C# IAtomContainer.getMaximumBondOrder怎么用?C# IAtomContainer.getMaximumBondOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAtomContainer的用法示例。


在下文中一共展示了IAtomContainer.getMaximumBondOrder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: couldMatchAtomType

		/// <summary> Determines if the atom can be of type AtomType.</summary>
		public virtual bool couldMatchAtomType(IAtomContainer container, IAtom atom, IAtomType type)
		{
			double bondOrderSum = container.getBondOrderSum(atom);
			double maxBondOrder = container.getMaximumBondOrder(atom);
			return couldMatchAtomType(atom, bondOrderSum, maxBondOrder, type);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:ValencyHybridChecker.cs

示例2: calculateNumberOfImplicitHydrogens

		public virtual int calculateNumberOfImplicitHydrogens(IAtom atom, IAtomContainer container)
		{
			return this.calculateNumberOfImplicitHydrogens(atom, container.getBondOrderSum(atom), container.getMaximumBondOrder(atom), container.getConnectedAtoms(atom).Length);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:4,代码来源:ValencyHybridChecker.cs

示例3: hasPerfectConfiguration

		public virtual bool hasPerfectConfiguration(IAtom atom, IAtomContainer ac)
		{
			double bondOrderSum = ac.getBondOrderSum(atom);
			double maxBondOrder = ac.getMaximumBondOrder(atom);
			IAtomType[] atomTypes = getAtomTypeFactory(atom.Builder).getAtomTypes(atom.Symbol);
			if (atomTypes.Length == 0)
				return true;
			//logger.debug("*** Checking for perfect configuration ***");
			try
			{
				//logger.debug("Checking configuration of atom " + ac.getAtomNumber(atom));
				//logger.debug("Atom has bondOrderSum = " + bondOrderSum);
				//logger.debug("Atom has max = " + bondOrderSum);
			}
			catch (System.Exception exc)
			{
			}
			for (int f = 0; f < atomTypes.Length; f++)
			{
				if (bondOrderSum == atomTypes[f].BondOrderSum && maxBondOrder == atomTypes[f].MaxBondOrder)
				{
					try
					{
						//logger.debug("Atom " + ac.getAtomNumber(atom) + " has perfect configuration");
					}
					catch (System.Exception exc)
					{
					}
					return true;
				}
			}
			try
			{
				//logger.debug("*** Atom " + ac.getAtomNumber(atom) + " has imperfect configuration ***");
			}
			catch (System.Exception exc)
			{
			}
			return false;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:40,代码来源:SaturationChecker.cs

示例4: isSaturated

		/// <summary> Checks wether an Atom is saturated by comparing it with known AtomTypes.
		/// It returns true if the atom is an PseudoAtom and when the element is not in the list.
		/// </summary>
		public virtual bool isSaturated(IAtom atom, IAtomContainer container)
		{
			if (atom is IPseudoAtom)
			{
				//logger.debug("don't figure it out... it simply does not lack H's");
				return true;
			}
			
			IAtomType[] atomTypes = getAtomTypeFactory(atom.Builder).getAtomTypes(atom.Symbol);
			if (atomTypes.Length == 0)
			{
				//logger.warn("Missing entry in atom type list for ", atom.Symbol);
				return true;
			}
			double bondOrderSum = container.getBondOrderSum(atom);
			double maxBondOrder = container.getMaximumBondOrder(atom);
			int hcount = atom.getHydrogenCount();
			int charge = atom.getFormalCharge();
			
			//logger.debug("Checking saturation of atom ", atom.Symbol);
			//logger.debug("bondOrderSum: ", bondOrderSum);
			//logger.debug("maxBondOrder: ", maxBondOrder);
			//logger.debug("hcount: ", hcount);
			//logger.debug("charge: ", charge);
			
			bool elementPlusChargeMatches = false;
			for (int f = 0; f < atomTypes.Length; f++)
			{
				IAtomType type = atomTypes[f];
				if (couldMatchAtomType(atom, bondOrderSum, maxBondOrder, type))
				{
					if (bondOrderSum + hcount == type.BondOrderSum && maxBondOrder <= type.MaxBondOrder)
					{
						//logger.debug("We have a match: ", type);
						//logger.debug("Atom is saturated: ", atom.Symbol);
						return true;
					}
					else
					{
						// ok, the element and charge matche, but unfulfilled
						elementPlusChargeMatches = true;
					}
				} // else: formal charges don't match
			}
			
			if (elementPlusChargeMatches)
			{
				//logger.debug("No, atom is not saturated.");
				return false;
			}
			
			// ok, the found atom was not in the list
			throw new CDKException("The atom with element " + atom.Symbol + " and charge " + charge + " is not found.");
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:57,代码来源:ValencyHybridChecker.cs

示例5: isOverSaturated

		/// <summary> Checks if the current atom has exceeded its bond order sum value.
		/// 
		/// </summary>
		/// <param name="atom">The Atom to check
		/// </param>
		/// <param name="ac">  The atomcontainer context
		/// </param>
		/// <returns>      oversaturated or not
		/// </returns>
		public virtual bool isOverSaturated(IAtom atom, IAtomContainer ac)
		{
			IAtomType[] atomTypes = getAtomTypeFactory(atom.Builder).getAtomTypes(atom.Symbol);
			if (atomTypes.Length == 0)
				return false;
			double bondOrderSum = ac.getBondOrderSum(atom);
			double maxBondOrder = ac.getMaximumBondOrder(atom);
			int hcount = atom.getHydrogenCount();
			int charge = atom.getFormalCharge();
			try
			{
				//logger.debug("*** Checking saturation of atom " + ac.getAtomNumber(atom) + " ***");
				//logger.debug("bondOrderSum: " + bondOrderSum);
				//logger.debug("maxBondOrder: " + maxBondOrder);
				//logger.debug("hcount: " + hcount);
			}
			catch (System.Exception exc)
			{
			}
			for (int f = 0; f < atomTypes.Length; f++)
			{
				if (bondOrderSum - charge + hcount > atomTypes[f].BondOrderSum)
				{
					//logger.debug("*** Good ! ***");
					return true;
				}
			}
			//logger.debug("*** Bad ! ***");
			return false;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:39,代码来源:SaturationChecker.cs


注:本文中的IAtomContainer.getMaximumBondOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。