示例#1
0
 /** Copy constructor. */
 public FDCTMCSimple(FDCTMCSimple fdctmc) {
   super(fdctmc);
   this.fdEvents = new ArrayList<FDEvent>(fdctmc.getNumFDEvents());
   for (int i = 0; i < fdctmc.getNumFDEvents(); ++i) {
     this.fdEvents.add(new FDEvent(fdctmc.getFDEvent(i)));
   }
   this.transToSynchLabel = fdctmc.transToSynchLabel; // TODO perform deep copy if needed
 }
示例#2
0
  /**
   * TODO: implement properly Construct a FDCTMC from an existing one and a state in permutation,
   * i.e. in which state index i becomes index permut[i]. Note: have to build new Distributions from
   * scratch anyway to do this, so may as well provide this functionality as a constructor.
   */
  public FDCTMCSimple(FDCTMCSimple fdctmc, int permut[]) {
    super(fdctmc, permut);
    this.fdEvents = new ArrayList<FDEvent>(fdctmc.getNumFDEvents());
    for (int i = 0; i < fdctmc.getNumFDEvents(); ++i) {
      this.fdEvents.add(new FDEvent(fdctmc.getFDEvent(i), permut));
    }

    transToSynchLabel =
        new HashMap<Integer, Map<Integer, Map<Integer, String>>>(fdctmc.getNumFDEvents() + 1);
    if (fdctmc.transToSynchLabel == null) return;

    for (int i : fdctmc.transToSynchLabel.keySet()) {
      Map<Integer, Map<Integer, String>> sources = new HashMap<Integer, Map<Integer, String>>();
      for (int src : fdctmc.transToSynchLabel.get(i).keySet()) {
        Map<Integer, String> destinations =
            new HashMap<Integer, String>(fdctmc.transToSynchLabel.get(i).get(src).size());
        for (Entry<Integer, String> dest : fdctmc.transToSynchLabel.get(i).get(src).entrySet())
          destinations.put(permut[dest.getKey()], dest.getValue());
        sources.put(permut[src], destinations);
      }
      transToSynchLabel.put(i, sources);
    }
  }