hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel
Class ResourceSpreader.FreqSyncer

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.Timed
      extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ResourceSpreader.FreqSyncer
All Implemented Interfaces:
Comparable<Timed>
Enclosing class:
ResourceSpreader

public static class ResourceSpreader.FreqSyncer
extends Timed


Field Summary
private  ArrayList<ResourceSpreader> depGroupExtension
           
private  int depgrouplen
           
private  int firstConsumerId
           
private  ResourceSpreader[] myDepGroup
          myDepGroup is always kept in order: first all the providers are listed, then all the consumers, when dealing with this data member please keep in mind this expected behavior.
private  boolean nudged
           
private  boolean regularFreqMode
           
 
Constructor Summary
private ResourceSpreader.FreqSyncer(ResourceSpreader[] myDepGroup, int provcount, int dglen)
           
private ResourceSpreader.FreqSyncer(ResourceSpreader provider, ResourceSpreader consumer)
           
 
Method Summary
private  void addSingleToDG(ResourceSpreader rs)
          Should only be used from addToGroup!
private  void addToGroup()
           
private  void buildDepGroup(ResourceSpreader startingItem)
           
 ResourceSpreader[] getClonedDepGroup()
          This will always give a fresh copy of the depgroup which can be changed as the user desires.
(package private)  ResourceSpreader[] getDepGroup()
          Only those should get the depgroup with this function who are not planning to change it's contents WARNING: If, for some reason, the contents of the returned array are changed then the proper operation of FreqSyncer cannot be guaranteed anymore.
 int getDGLen()
           
 int getFirstConsumerId()
           
private  boolean isInDepGroup(ResourceSpreader lookfor)
           
 boolean isRegularFreqMode()
           
(package private)  void nudge()
           
protected  void outOfOrderProcessing(long currentTime)
           
 void tick(long fires)
           
 String toString()
           
private  void updateMyFreqNow()
           
 
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.Timed
calcTimeJump, compareTo, fire, getFireCount, getFrequency, getNextEvent, getNextFire, isSubscribed, jumpTime, nextEventDistance, resetTimed, setBackPreference, simulateUntil, simulateUntilLastEvent, skipEventsTill, subscribe, unsubscribe, updateFrequency
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myDepGroup

private ResourceSpreader[] myDepGroup
myDepGroup is always kept in order: first all the providers are listed, then all the consumers, when dealing with this data member please keep in mind this expected behavior.


depgrouplen

private int depgrouplen

firstConsumerId

private int firstConsumerId

depGroupExtension

private final ArrayList<ResourceSpreader> depGroupExtension

nudged

private boolean nudged

regularFreqMode

private boolean regularFreqMode
Constructor Detail

ResourceSpreader.FreqSyncer

private ResourceSpreader.FreqSyncer(ResourceSpreader provider,
                                    ResourceSpreader consumer)

ResourceSpreader.FreqSyncer

private ResourceSpreader.FreqSyncer(ResourceSpreader[] myDepGroup,
                                    int provcount,
                                    int dglen)
Method Detail

addSingleToDG

private void addSingleToDG(ResourceSpreader rs)
Should only be used from addToGroup!

Parameters:
rs -

addToGroup

private void addToGroup()

isInDepGroup

private boolean isInDepGroup(ResourceSpreader lookfor)

nudge

void nudge()

getDepGroup

ResourceSpreader[] getDepGroup()
Only those should get the depgroup with this function who are not planning to change it's contents WARNING: If, for some reason, the contents of the returned array are changed then the proper operation of FreqSyncer cannot be guaranteed anymore.

Returns:

getDGLen

public int getDGLen()

getClonedDepGroup

public ResourceSpreader[] getClonedDepGroup()
This will always give a fresh copy of the depgroup which can be changed as the user desires. Because of the always copying behavior it will reduce the performance a little.

Returns:

toString

public String toString()
Overrides:
toString in class Timed

getFirstConsumerId

public int getFirstConsumerId()

outOfOrderProcessing

protected final void outOfOrderProcessing(long currentTime)

tick

public void tick(long fires)
Specified by:
tick in class Timed

updateMyFreqNow

private void updateMyFreqNow()

isRegularFreqMode

public boolean isRegularFreqMode()

buildDepGroup

private void buildDepGroup(ResourceSpreader startingItem)


Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.