public boolean executeTransition(int k)
   {
       ArrayList<Integer> markings = isActive();
       if (markings == null) {
           return false;
       }
       int marking = markings.get(k); //token
       /* Minus for input arcs */
       for(Arc arc : listOfInArcs)
       {    
           AbsPlace outElement=(AbsPlace)arc.getOutElement();
           if (outElement instanceof Resource) {
               int outMarkingOld = outElement.getMarking();
               outElement.setMarking(outMarkingOld - arc.getCapacity());
               Resource r=(Resource)outElement;
               r.incrementProcess(marking);        
           }else
           {
               Place outPlace = (Place)outElement;
               outPlace.removeMarking(marking);
           }    
       }
       /* Plus for output arcs */
       for(Arc arc : listOfOutArcs)
       {
           AbsPlace inElement=(AbsPlace)arc.getInElement();
           if (inElement instanceof Resource) {
               int inMarkingOld=inElement.getMarking();
               inElement.setMarking(inMarkingOld+arc.getCapacity());  
               Resource r=(Resource)inElement;
               r.decrementProcess(marking);

           }else{
               Place inPlace = (Place)inElement;
               inPlace.getMarkings().getMarkings().add(marking);
               Collections.sort(inPlace.getMarkings().getMarkings());
           }
       }
       return true;
       
   }