getTrigger() public method

public getTrigger ( ) : Trigger
return Trigger
示例#1
0
        /// <summary>
        ///    Creates a MoBi Event by the given SBML Event.
        /// </summary>
        internal void CreateEvent(Event sbmlEvent)
        {
            EventBuilder = new EventBuilder()
                           .WithId(sbmlEvent.getId() + SBMLConstants.SBML_EVENTBUILDER)
                           .WithName(sbmlEvent.getId())
                           .WithDescription(sbmlEvent.getNotesString());

            if (sbmlEvent.isSetTrigger())
            {
                CreateCondition(sbmlEvent.getTrigger());
            }
            CreateEventAssignments(sbmlEvent);
            CreateWarningsForUnsupportedFeatures(sbmlEvent);

            EventGroupBuilder.Add(EventBuilder);
        }
示例#2
0
    private static void printEventMath(int n, Event e)
    {
        string formula;
        int i;

        if (e.isSetDelay())
        {
            formula = libsbml.formulaToString(e.getDelay().getMath());
            Console.Write("Event " + n + " delay: " + formula + Environment.NewLine);
        }

        if (e.isSetTrigger())
        {
            formula = libsbml.formulaToString(e.getTrigger().getMath());
            Console.Write("Event " + n + " trigger: " + formula + Environment.NewLine);
        }

        for (i = 0; i < e.getNumEventAssignments(); ++i)
        {
            printEventAssignmentMath(i + 1, e.getEventAssignment(i));
        }

        Console.WriteLine();
    }
 public void test_Trigger_parent_add()
 {
     Trigger d = new Trigger(2,4);
       Event e = new Event(2,4);
       e.setTrigger(d);
       d = null;
       assertTrue( e == e.getTrigger().getParentSBMLObject() );
       e = null;
 }
 public void test_Trigger_ancestor_create()
 {
     Event e = new Event(2,4);
       Trigger ea = e.createTrigger();
       assertTrue( ea.getAncestorOfType(libsbml.SBML_EVENT) == e );
       assertTrue( ea.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( ea.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
       Trigger obj = e.getTrigger();
       assertTrue( obj.getAncestorOfType(libsbml.SBML_EVENT) == e );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
 }
 public void test_Trigger_ancestor_add()
 {
     Trigger d = new Trigger(2,4);
       Event e = new Event(2,4);
       e.setTrigger(d);
       d = null;
       Trigger obj = e.getTrigger();
       assertTrue( obj.getAncestorOfType(libsbml.SBML_EVENT) == e );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       e = null;
 }
 public void test_Trigger_parent_add()
 {
     Trigger d = new Trigger(2,4);
       d.setMath(libsbml.parseFormula("true"));
       Event e = new Event(2, 4);
       e.setTrigger(d);
       d = null;
       assertTrue( e == e.getTrigger().getParentSBMLObject() );
       e = null;
 }