All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.unibo.alchemist.core.interfaces.DependencyHandler Maven / Gradle / Ivy

There is a newer version: 20.0.1
Show newest version
/*
 * Copyright (C) 2010-2014, Danilo Pianini and contributors
 * listed in the project's pom.xml file.
 * 
 * This file is part of Alchemist, and is distributed under the terms of
 * the GNU General Public License, with a linking exception, as described
 * in the file LICENSE in the Alchemist distribution's top directory.
 */
package it.unibo.alchemist.core.interfaces;

import it.unibo.alchemist.model.interfaces.Reaction;

import java.io.Serializable;
import java.util.List;


/**
 * @param  Concentration type
 */
public interface DependencyHandler extends Serializable, Comparable> {

    /**
     * Adds r to those reactions whose execution implies an update of the times
     * of this reaction.
     * 
     * @param r
     *            the reaction
     */
    void addInDependency(DependencyHandler r);

    /**
     * Adds r to those reactions ifluenced by the execution of this reaction.
     * 
     * @param r
     *            the reaction
     */
    void addOutDependency(DependencyHandler r);

    /**
     * @return a list handlers of those reaction whose execution means an
     *         update. to this current reaction.
     */
    List> dependsOn();

    /**
     * @return The reaction.
     */
    Reaction getReaction();

    /**
     * Calculates the reactions which are influenced by this one.
     * 
     * @return a list handlers of those reaction whose times needs to be updated
     *         after the execution of the current reaction.
     */
    List> influences();

    /**
     * Calculates the reactions which influence by this one.
     * 
     * @return a list handlers of those reaction whose execution implies a time
     *         update for this reaction.
     */
    List> isInfluenced();

    /**
     * Removes an in dependency. If the dependency was not present, this method
     * has no effect.
     * 
     * @param rh
     *            the reaction to be removed from the list
     */
    void removeInDependency(DependencyHandler rh);

    /**
     * Removes an out dependency. If the dependency was not present, this method
     * has no effect.
     * 
     * @param rh
     *            the reaction to be removed from the list
     */
    void removeOutDependency(DependencyHandler rh);

    /**
     * Allows to change the in dependencies for this handler. No soundness is
     * guaranteed for this change. Be careful.
     * 
     * @param dep
     *            the list of the in dependencies.
     */
    void setInDependencies(List> dep);

    /**
     * Allows to change the in dependencies for this handler. No soundness is
     * guaranteed for this change. Be careful.
     * 
     * @param dep
     *            the list of the out dependencies
     */
    void setOutDependencies(List> dep);



}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy