doc.addTreeNodeChangeListener(this);
Model model = doc.createModel("event_model");
Compartment c = model.createCompartment("compartment");
model.createSpecies("s1", c);
model.createSpecies("s2", c);
Event ev = model.createEvent();
Trigger trigger = ev.createTrigger(false, true, ASTNode.parseFormula("3 >= 2"));
trigger.setMath(ASTNode.geq(new ASTNode(ASTNode.Type.NAME_TIME),
new ASTNode(10)));
ev.createPriority(ASTNode.parseFormula("25"));
ev.createDelay(ASTNode.parseFormula("2"));
ev.createEventAssignment("s1", ASTNode.parseFormula("s2"));
System.out.println("==================================");
new SBMLWriter().write(doc, System.out);
System.out.println("\n==================================");
doc.setLevelAndVersion(2, 4);
System.out.println("==================================");