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

            return(ret);
        }
 public void setUp()
 {
     E = new  InitialAssignment(2,4);
       if (E == null);
       {
       }
 }
Пример #3
0
 InitialAssignment(InitialAssignment orig) : this(libsbmlPINVOKE.new_InitialAssignment__SWIG_2(InitialAssignment.getCPtr(orig)), true)
 {
     if (libsbmlPINVOKE.SWIGPendingException.Pending)
     {
         throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
     }
 }
        InitialAssignment remove(long n)
        {
            global::System.IntPtr cPtr = libsbmlPINVOKE.ListOfInitialAssignments_remove__SWIG_0(swigCPtr, n);
            InitialAssignment     ret  = (cPtr == global::System.IntPtr.Zero) ? null : new InitialAssignment(cPtr, true);

            return(ret);
        }
        InitialAssignment get(long n)
        {
            IntPtr            cPtr = libsbmlPINVOKE.ListOfInitialAssignments_get__SWIG_0(swigCPtr, n);
            InitialAssignment ret  = (cPtr == IntPtr.Zero) ? null : new InitialAssignment(cPtr, false);

            return(ret);
        }
        InitialAssignment remove(string sid)
        {
            global::System.IntPtr cPtr = libsbmlPINVOKE.ListOfInitialAssignments_remove__SWIG_1(swigCPtr, sid);
            InitialAssignment     ret  = (cPtr == global::System.IntPtr.Zero) ? null : new InitialAssignment(cPtr, true);

            if (libsbmlPINVOKE.SWIGPendingException.Pending)
            {
                throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        InitialAssignment get(string sid)
        {
            IntPtr            cPtr = libsbmlPINVOKE.ListOfInitialAssignments_get__SWIG_2(swigCPtr, sid);
            InitialAssignment ret  = (cPtr == IntPtr.Zero) ? null : new InitialAssignment(cPtr, false);

            if (libsbmlPINVOKE.SWIGPendingException.Pending)
            {
                throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #8
0
        internal static HandleRef getCPtrAndDisown(InitialAssignment obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

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

            return(ptr);
        }
 public void test_InitialAssignment_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,3);
       sbmlns.addNamespaces(xmlns);
       InitialAssignment object1 = new  InitialAssignment(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_INITIAL_ASSIGNMENT );
       assertTrue( object1.getMetaId() == "" );
       assertTrue( object1.getNotes() == null );
       assertTrue( object1.getAnnotation() == null );
       assertTrue( object1.getLevel() == 2 );
       assertTrue( object1.getVersion() == 3 );
       assertTrue( object1.getNamespaces() != null );
       assertTrue( object1.getNamespaces().getLength() == 2 );
       object1 = null;
 }
 public void tearDown()
 {
     E = null;
 }
 public void test_InitialAssignment()
 {
     InitialAssignment ia = new InitialAssignment(2,4);
       assertEquals( false, (ia.hasRequiredAttributes()) );
       ia.setSymbol("ia");
       assertEquals( true, ia.hasRequiredAttributes() );
       ia = null;
 }
 public void tearDown()
 {
     IA = null;
 }
Пример #13
0
 internal static HandleRef getCPtr(InitialAssignment obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Пример #14
0
        internal static HandleRef getCPtrAndDisown(InitialAssignment obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

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

            return ptr;
        }
 public void test_InitialAssignment()
 {
     InitialAssignment ia = new InitialAssignment(2,4);
       assertEquals( false, (ia.hasRequiredElements()) );
       ia.setMath(libsbml.parseFormula("ia"));
       assertEquals( true, ia.hasRequiredElements() );
       ia = null;
 }
Пример #16
0
 /**
    * Copy constructor; creates a copy of this InitialAssignment.
    *
    * @param orig the object to copy.
    *
    * @throws @if python ValueError @else SBMLConstructorException @endif
    * Thrown if the argument @p orig is @c null.
    */
 public InitialAssignment(InitialAssignment orig)
     : this(libsbmlPINVOKE.new_InitialAssignment__SWIG_2(InitialAssignment.getCPtr(orig)), true)
 {
     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
 }
Пример #17
0
 public void test_Model_addInitialAssignment4()
 {
     Model m = new  Model(2,2);
       InitialAssignment ia = new  InitialAssignment(2,2);
       ia.setSymbol( "ia");
       ia.setMath(libsbml.parseFormula("a+b"));
       InitialAssignment ia1 = new  InitialAssignment(2,2);
       ia1.setSymbol( "ia");
       ia1.setMath(libsbml.parseFormula("a+b"));
       int i = m.addInitialAssignment(ia);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumInitialAssignments() == 1 );
       i = m.addInitialAssignment(ia1);
       assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID );
       assertTrue( m.getNumInitialAssignments() == 1 );
       ia = null;
       ia1 = null;
       m = null;
 }
Пример #18
0
 public void test_Model_addInitialAssignment2()
 {
     Model m = new  Model(2,2);
       InitialAssignment ia = new  InitialAssignment(2,3);
       ia.setSymbol( "i");
       ia.setMath(libsbml.parseFormula("gg"));
       int i = m.addInitialAssignment(ia);
       assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
       assertTrue( m.getNumInitialAssignments() == 0 );
       ia = null;
       m = null;
 }
Пример #19
0
 public void test_Model_addInitialAssignment1()
 {
     Model m = new  Model(2,2);
       InitialAssignment ia = new  InitialAssignment(2,2);
       int i = m.addInitialAssignment(ia);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       ia.setSymbol( "i");
       i = m.addInitialAssignment(ia);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       ia.setMath(libsbml.parseFormula("gg"));
       i = m.addInitialAssignment(ia);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumInitialAssignments() == 1 );
       ia = null;
       m = null;
 }
 public void test_internal_consistency_check_99913()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       InitialAssignment ia = new InitialAssignment(2,4);
       Model m = d.createModel();
       d.setLevelAndVersion(1,2,false);
       Compartment c = m.createCompartment();
       c.setId("cc");
       c.setConstant(false);
       m.addInitialAssignment(ia);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
Пример #21
0
 internal static HandleRef getCPtr(InitialAssignment obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Пример #22
0
 public void test_InitialAssignment_ancestor_add()
 {
     InitialAssignment ia = new InitialAssignment(2,4);
       Model m = new Model(2,4);
       ia.setSymbol("c");
       ia.setMath(libsbml.parseFormula("9"));
       m.addInitialAssignment(ia);
       ia = null;
       ListOf lo = m.getListOfInitialAssignments();
       InitialAssignment obj = m.getInitialAssignment(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == m );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_EVENT) == null );
 }
Пример #23
0
 /**
    * Adds a copy of the given InitialAssignment object to this Model.
    *
    * @param ia the InitialAssignment object to add
    *
    *
  * @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
    * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink
    * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink
    * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink
    *
    *
  * @note This method should be used with some caution.  The fact that this
  * method @em copies the object passed to it means that the caller will be
  * left holding a physically different object instance than the one contained
  * inside this object.  Changes made to the original object instance (such as
  * resetting attribute values) will <em>not affect the instance in this
  * object</em>.  In addition, the caller should make sure to free the
  * original object if it is no longer being used, or else a memory leak will
  * result.  Please see other methods on this class (particularly a
  * corresponding method whose name begins with the word <code>create</code>)
  * for alternatives that do not lead to these issues.
  *
  *
    *
    * @see createInitialAssignment()
    */
 public int addInitialAssignment(InitialAssignment ia)
 {
     int ret = libsbmlPINVOKE.Model_addInitialAssignment(swigCPtr, InitialAssignment.getCPtr(ia));
     return ret;
 }
 public void test_InitialAssignment_parent_add()
 {
     InitialAssignment ia = new InitialAssignment(2,4);
       Model m = new Model(2,4);
       ia.setSymbol("c");
       ia.setMath(libsbml.parseFormula("9"));
       m.addInitialAssignment(ia);
       ia = null;
       ListOf lo = m.getListOfInitialAssignments();
       assertTrue( lo == m.getInitialAssignment(0).getParentSBMLObject() );
       assertTrue( m == lo.getParentSBMLObject() );
 }
        public void test_InitialAssignment_constructor()
        {
            SBase s;

              try
              {
            s = new InitialAssignment(2,2);
            s = new InitialAssignment(2,3);
            s = new InitialAssignment(2,4);
            s = new InitialAssignment(3,1);
            s = new InitialAssignment(SN22);
            s = new InitialAssignment(SN23);
            s = new InitialAssignment(SN24);
            s = new InitialAssignment(SN31);
              }
              catch (SBMLConstructorException e)
              {
             s = null;
              }
              assertTrue(s != null);

              string msg = "";

              try
              {
            s = new InitialAssignment(1,1);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new InitialAssignment(1,2);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new InitialAssignment(2,1);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

               msg = "";
              try
              {
            s = new InitialAssignment(9,9);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new InitialAssignment(SN11);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new InitialAssignment(SN12);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new InitialAssignment(SN21);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";
              try
              {
            s = new InitialAssignment(SN99);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);
        }
Пример #26
0
 public void test_InitialAssignment_copyConstructor()
 {
     InitialAssignment o1 = new InitialAssignment(2,4);
       o1.setSymbol("c");
       assertTrue( o1.getId() ==  "c" );
       InitialAssignment o2 = new InitialAssignment(o1);
       assertTrue( o2.getId() ==  "c" );
       assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() );
       o2 = null;
       o1 = null;
 }