edu.byu.ece.edif.tools.replicate.nmr
Class ReplicationUtilizationTracker

java.lang.Object
  extended by edu.byu.ece.edif.tools.replicate.nmr.ReplicationUtilizationTracker

public class ReplicationUtilizationTracker
extends java.lang.Object

This class expects the UtilizationTracker to be pre initialized with the contents of the //unreplicated// cell. If this class is to be used on a second pass of the NMRSelection tool, previously made ReplicationType assignments will have to be made through this class before beginning the desired replication selection strategy. This class is intended to be used by an NMRSelectionStrategy in order to keep adding instances to be replicated until the device is full. Once the device is full, the selection strategy can use the getReplicationTypes and getInstancesWithReplicationType to know what to put in the ReplicationDescription object.


Field Summary
protected  java.util.HashSet<EdifCellInstance> _exclusionSet
           
protected  java.util.Map<EdifCellInstance,ReplicationType> _instanceMap
           
protected  java.util.Map<ReplicationType,java.util.List<EdifCellInstance>> _replicationMap
           
protected  DeviceUtilizationTracker _tracker
           
 
Constructor Summary
ReplicationUtilizationTracker(DeviceUtilizationTracker tracker)
           
 
Method Summary
protected  void addToPrivateDataStructures(EdifCellInstance eci, ReplicationType repType)
           
 void addToTracker(EdifCellInstance eci, ReplicationType repType, boolean override)
           
 void addToTrackerAsManyAsPossible(java.util.Collection<EdifCellInstance> instances, ReplicationType repType, boolean override)
           
 void addToTrackerAtomic(java.util.Collection<EdifCellInstance> instances, ReplicationType repType, boolean override)
          Add the instances as an atomic group and return whether or not the instances were able to be added.
 void excludeInstance(EdifCellInstance eci)
           
 java.util.Map<EdifCellInstance,ReplicationType> getInstanceReplicationMap()
           
 java.util.List<EdifCellInstance> getInstancesWithReplicationType(ReplicationType repType)
           
 java.util.Collection<ReplicationType> getReplicationTypes()
           
 boolean isExcluded(EdifCellInstance eci)
           
 boolean unexcludeInstance(EdifCellInstance eci)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_tracker

protected DeviceUtilizationTracker _tracker

_replicationMap

protected java.util.Map<ReplicationType,java.util.List<EdifCellInstance>> _replicationMap

_instanceMap

protected java.util.Map<EdifCellInstance,ReplicationType> _instanceMap

_exclusionSet

protected java.util.HashSet<EdifCellInstance> _exclusionSet
Constructor Detail

ReplicationUtilizationTracker

public ReplicationUtilizationTracker(DeviceUtilizationTracker tracker)
Method Detail

addToPrivateDataStructures

protected void addToPrivateDataStructures(EdifCellInstance eci,
                                          ReplicationType repType)
Parameters:
eci -
repType -
override -

addToTracker

public void addToTracker(EdifCellInstance eci,
                         ReplicationType repType,
                         boolean override)
                  throws OverutilizationEstimatedStopException,
                         OverutilizationHardStopException,
                         UnsupportedResourceTypeException,
                         DuplicateNMRRequestException
Throws:
OverutilizationEstimatedStopException
OverutilizationHardStopException
UnsupportedResourceTypeException
DuplicateNMRRequestException

addToTrackerAtomic

public void addToTrackerAtomic(java.util.Collection<EdifCellInstance> instances,
                               ReplicationType repType,
                               boolean override)
                        throws OverutilizationEstimatedStopException,
                               OverutilizationHardStopException,
                               UnsupportedResourceTypeException,
                               DuplicateNMRRequestException
Add the instances as an atomic group and return whether or not the instances were able to be added.

Parameters:
instances -
repType -
override -
Throws:
OverutilizationEstimatedStopException
OverutilizationHardStopException
UnsupportedResourceTypeException
DuplicateNMRRequestException

addToTrackerAsManyAsPossible

public void addToTrackerAsManyAsPossible(java.util.Collection<EdifCellInstance> instances,
                                         ReplicationType repType,
                                         boolean override)
                                  throws OverutilizationEstimatedStopException,
                                         OverutilizationHardStopException,
                                         UnsupportedResourceTypeException,
                                         DuplicateNMRRequestException
Throws:
OverutilizationEstimatedStopException
OverutilizationHardStopException
UnsupportedResourceTypeException
DuplicateNMRRequestException

isExcluded

public boolean isExcluded(EdifCellInstance eci)

excludeInstance

public void excludeInstance(EdifCellInstance eci)

unexcludeInstance

public boolean unexcludeInstance(EdifCellInstance eci)

getReplicationTypes

public java.util.Collection<ReplicationType> getReplicationTypes()

getInstancesWithReplicationType

public java.util.List<EdifCellInstance> getInstancesWithReplicationType(ReplicationType repType)

getInstanceReplicationMap

public java.util.Map<EdifCellInstance,ReplicationType> getInstanceReplicationMap()