Пример #1
0
        KineticLaw clone()
        {
            global::System.IntPtr cPtr = libsbmlPINVOKE.KineticLaw_clone(swigCPtr);
            KineticLaw            ret  = (cPtr == global::System.IntPtr.Zero) ? null : new KineticLaw(cPtr, true);

            return(ret);
        }
Пример #2
0
 public void test_KineticLaw_getParameterById()
 {
     Parameter k1 = new  Parameter(2,4);
       Parameter k2 = new  Parameter(2,4);
       k1.setId( "k1");
       k2.setId( "k2");
       k1.setValue(3.14);
       k2.setValue(2.72);
       M.addParameter(k1);
       M.addParameter(k2);
       Reaction r1 = new  Reaction(2,4);
       r1.setId( "reaction_1" );
       KineticLaw kl = new  KineticLaw(2,4);
       kl.setFormula( "k1 * X0");
       Parameter k3 = new  Parameter(2,4);
       Parameter k4 = new  Parameter(2,4);
       k3.setId( "k1");
       k4.setId( "k2");
       k3.setValue(2.72);
       k4.setValue(3.14);
       kl.addParameter(k3);
       kl.addParameter(k4);
       r1.setKineticLaw(kl);
       M.addReaction(r1);
       KineticLaw kl1 = M.getReaction(0).getKineticLaw();
       assertNotEquals(kl1.getParameter( "k1" ),k3);
       assertNotEquals(kl1.getParameter( "k1" ),k1);
       assertNotEquals(kl1.getParameter( "k2" ),k4);
       assertEquals(kl1.getParameter( "k3" ),null);
 }
 public void setUp()
 {
     kl = new  KineticLaw(2,4);
       if (kl == null);
       {
       }
 }
Пример #4
0
 KineticLaw(KineticLaw orig) : this(libsbmlPINVOKE.new_KineticLaw__SWIG_2(KineticLaw.getCPtr(orig)), true)
 {
     if (libsbmlPINVOKE.SWIGPendingException.Pending)
     {
         throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public void test_KineticLaw_addParameter2()
 {
     KineticLaw kl = new  KineticLaw(2,2);
       Parameter p = new  Parameter(2,1);
       p.setId( "p");
       int i = kl.addParameter(p);
       assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
       assertTrue( kl.getNumParameters() == 0 );
       p = null;
       kl = null;
 }
Пример #6
0
        internal static HandleRef getCPtrAndDisown(KineticLaw obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

            if (obj != null)
            {
                ptr             = obj.swigCPtr;
                obj.swigCMemOwn = false;
            }

            return(ptr);
        }
 public void test_KineticLaw_addParameter1()
 {
     KineticLaw kl = new  KineticLaw(2,2);
       Parameter p = new  Parameter(2,2);
       int i = kl.addParameter(p);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       p.setId( "p");
       i = kl.addParameter(p);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( kl.getNumParameters() == 1 );
       p = null;
       kl = null;
 }
Пример #8
0
        internal static HandleRef getCPtrAndDisown(KineticLaw obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

            if (obj != null)
            {
            ptr             = obj.swigCPtr;
            obj.swigCMemOwn = false;
            }

            return ptr;
        }
Пример #9
0
 internal static HandleRef getCPtr(KineticLaw obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Пример #10
0
 public void test_KineticLaw_Parameter_ancestor_create()
 {
     KineticLaw kl = new KineticLaw(2,4);
       Parameter p = kl.createParameter();
       assertTrue( kl.getNumParameters() == 1 );
       ListOfParameters lop = kl.getListOfParameters();
       assertTrue( p.getAncestorOfType(libsbml.SBML_KINETIC_LAW) == kl );
       assertTrue( p.getAncestorOfType(libsbml.SBML_LIST_OF) == lop );
       assertTrue( p.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( p.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
       Parameter obj = kl.getParameter(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_KINETIC_LAW) == kl );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lop );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
       kl = null;
 }
Пример #11
0
 public void test_KineticLaw()
 {
     KineticLaw kl = new KineticLaw(2,4);
       assertEquals( true, kl.hasRequiredAttributes() );
       kl = null;
 }
Пример #12
0
 public void test_KineticLaw_parent_add()
 {
     KineticLaw kl = new KineticLaw(2,4);
       Reaction r = new Reaction(2,4);
       r.setKineticLaw(kl);
       assertTrue( r == r.getKineticLaw().getParentSBMLObject() );
       r = null;
 }
Пример #13
0
 public void test_KineticLaw_L1()
 {
     KineticLaw kl = new KineticLaw(1,2);
       assertEquals( false, (kl.hasRequiredAttributes()) );
       kl.setFormula("kl");
       assertEquals( true, kl.hasRequiredAttributes() );
       kl = null;
 }
Пример #14
0
 public void test_Reaction_setKineticLaw2()
 {
     KineticLaw kl = new  KineticLaw(1,1);
       int i = R.setKineticLaw(kl);
       assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
       assertEquals( false, R.isSetKineticLaw() );
       kl = null;
 }
Пример #15
0
 public void test_Reaction_setKineticLaw3()
 {
     KineticLaw kl = new  KineticLaw(1,2);
       int i = R.setKineticLaw(kl);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( true, R.isSetKineticLaw() );
       kl = null;
 }
Пример #16
0
 public void test_KineticLaw()
 {
     KineticLaw kl = new KineticLaw(2,4);
       assertEquals( false, (kl.hasRequiredElements()) );
       kl.setMath(libsbml.parseFormula("kl"));
       assertEquals( true, kl.hasRequiredElements() );
       kl = null;
 }
Пример #17
0
 public void test_KineticLaw_Parameter_parent_add()
 {
     KineticLaw kl = new KineticLaw(2,4);
       Parameter p = new Parameter(2,4);
       p.setId("jake");
       kl.addParameter(p);
       p = null;
       assertTrue( kl.getNumParameters() == 1 );
       assertTrue( kl.getParameter(0).getId() ==  "jake" );
       ListOfParameters lop = kl.getListOfParameters();
       assertTrue( kl == lop.getParentSBMLObject() );
       assertTrue( lop == kl.getParameter(0).getParentSBMLObject() );
       kl = null;
 }
        public void test_KineticLaw_constructor()
        {
            SBase s;

              try
              {
            s = new KineticLaw(1,1);
            s = new KineticLaw(1,2);
            s = new KineticLaw(2,1);
            s = new KineticLaw(2,2);
            s = new KineticLaw(2,3);
            s = new KineticLaw(2,4);
            s = new KineticLaw(SN11);
            s = new KineticLaw(SN12);
            s = new KineticLaw(SN21);
            s = new KineticLaw(SN22);
            s = new KineticLaw(SN23);
            s = new KineticLaw(SN24);
              }
              catch (SBMLConstructorException e)
              {
             s = null;
              }
              assertTrue(s != null);

              string msg = "";

              try
              {
            s = new KineticLaw(99,99);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);
        }
Пример #19
0
 /**
    * Copy constructor; creates a copy of this KineticLaw.
    *
    * @param orig the object to copy.
    */
 public KineticLaw(KineticLaw orig)
     : this(libsbmlPINVOKE.new_KineticLaw__SWIG_2(KineticLaw.getCPtr(orig)), true)
 {
     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
 }
 public void test_KineticLaw_createParameter()
 {
     KineticLaw kl = new  KineticLaw(2,2);
       Parameter p = kl.createParameter();
       assertTrue( kl.getNumParameters() == 1 );
       assertTrue( (p).getLevel() == 2 );
       assertTrue( (p).getVersion() == 2 );
       kl = null;
 }
Пример #21
0
 internal static HandleRef getCPtr(KineticLaw obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
 public void test_KineticLaw_setTimeUnits3()
 {
     KineticLaw kl1 = new  KineticLaw(1,2);
       int i = kl1.setTimeUnits( "1second");
       assertTrue( i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE );
       assertEquals( false, kl1.isSetTimeUnits() );
       i = kl1.unsetTimeUnits();
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( false, kl1.isSetTimeUnits() );
       kl1 = null;
 }
Пример #23
0
 public void test_KineticLaw_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,1);
       sbmlns.addNamespaces(xmlns);
       KineticLaw object1 = new  KineticLaw(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_KINETIC_LAW );
       assertTrue( object1.getMetaId() == "" );
       assertTrue( object1.getNotes() == null );
       assertTrue( object1.getAnnotation() == null );
       assertTrue( object1.getLevel() == 2 );
       assertTrue( object1.getVersion() == 1 );
       assertTrue( object1.getNamespaces() != null );
       assertTrue( object1.getNamespaces().getLength() == 2 );
       object1 = null;
 }
Пример #24
0
 public void test_KineticLaw_Parameter_parent_create()
 {
     KineticLaw kl = new KineticLaw(2,4);
       Parameter p = kl.createParameter();
       assertTrue( kl.getNumParameters() == 1 );
       ListOfParameters lop = kl.getListOfParameters();
       assertTrue( kl == lop.getParentSBMLObject() );
       assertTrue( lop == p.getParentSBMLObject() );
       assertTrue( lop == kl.getParameter(0).getParentSBMLObject() );
       kl = null;
 }
 public void test_KineticLaw_addParameter4()
 {
     KineticLaw kl = new  KineticLaw(2,2);
       Parameter p = null;
       int i = kl.addParameter(p);
       assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
       assertTrue( kl.getNumParameters() == 0 );
       kl = null;
 }
Пример #26
0
 public void test_KineticLaw_copyConstructor()
 {
     KineticLaw o1 = new KineticLaw(2,4);
       Parameter p = new Parameter(2,4);
       p.setId("jake");
       o1.addParameter(p);
       p = null;
       assertTrue( o1.getNumParameters() == 1 );
       assertTrue( o1.getParameter(0).getId() ==  "jake" );
       KineticLaw o2 = new KineticLaw(o1);
       assertTrue( o2.getNumParameters() == 1 );
       assertTrue( o2.getParameter(0).getId() ==  "jake" );
       assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() );
       o2 = null;
       o1 = null;
 }
 public void test_KineticLaw_setSubstanceUnits2()
 {
     KineticLaw kl1 = new  KineticLaw(1,2);
       int i = kl1.setSubstanceUnits( "mole");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( true, kl1.isSetSubstanceUnits() );
       i = kl1.unsetSubstanceUnits();
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( false, kl1.isSetSubstanceUnits() );
       kl1 = null;
 }
Пример #28
0
 public void test_Reaction_copyConstructor()
 {
     Reaction o1 = new Reaction(2,4);
       o1.setId("c");
       assertTrue( o1.getId() ==  "c" );
       KineticLaw kl = new KineticLaw(2,4);
       o1.setKineticLaw(kl);
       kl = null;
       assertTrue( o1.isSetKineticLaw() == true );
       assertNotEquals(o1.getKineticLaw(),null);
       Reaction o2 = new Reaction(o1);
       assertTrue( o2.getId() ==  "c" );
       assertTrue( o2.isSetKineticLaw() == true );
       assertNotEquals(o2.getKineticLaw(),null);
       assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() );
       o2 = null;
       o1 = null;
 }
 public void test_KineticLaw_setTimeUnits4()
 {
     KineticLaw kl1 = new  KineticLaw(1,2);
       int i = kl1.setTimeUnits("");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( false, kl1.isSetTimeUnits() );
       kl1 = null;
 }
 public void test_internal_consistency_check_99904_kl()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       KineticLaw kl = new KineticLaw(2,4);
       Model m = d.createModel();
       d.setLevelAndVersion(1,2,false);
       Compartment c = m.createCompartment();
       c.setId("cc");
       Reaction r = m.createReaction();
       r.setId("r");
       kl.setFormula("2");
       kl.setMetaId("mmm");
       r.setKineticLaw(kl);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
 public void tearDown()
 {
     kl = null;
 }
 public void test_internal_consistency_check_99911_kl()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       d.setLevelAndVersion(2,1,false);
       long errors;
       Model m = d.createModel();
       Reaction r = m.createReaction();
       r.setId("r");
       KineticLaw kl = new KineticLaw(2,4);
       kl.setSBOTerm(2);
       Parameter p = kl.createParameter();
       p.setId("p");
       r.setKineticLaw(kl);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
Пример #33
0
 /**
    * Sets the 'kineticLaw' subelement of this Reaction to a copy of the
    * given KineticLaw object.
    *
    * @param kl the KineticLaw object to use.
    *
    *
  * @return integer value indicating success/failure of the
  * function.  @if clike The value is drawn from the
  * enumeration #OperationReturnValues_t. @endif The possible values
  * returned by this function are:
  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
    * @li @link libsbml#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH@endlink
    * @li @link libsbml#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH@endlink
   */
 public int setKineticLaw(KineticLaw kl)
 {
     int ret = libsbmlPINVOKE.Reaction_setKineticLaw(swigCPtr, KineticLaw.getCPtr(kl));
     return ret;
 }
Пример #34
0
 public void test_KineticLaw_Parameter_ancestor_add()
 {
     KineticLaw kl = new KineticLaw(2,4);
       Parameter p = new Parameter(2,4);
       p.setId("jake");
       kl.addParameter(p);
       p = null;
       ListOfParameters lop = kl.getListOfParameters();
       Parameter obj = kl.getParameter(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_KINETIC_LAW) == kl );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lop );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
       kl = null;
 }