public class SFReactor extends SFRComposite
Class represents a sodium fast reactor at the highest core-level view.
iComponentVisitor
iComponentListener
Constructor and Description |
---|
SFReactor(int size)
Parameterized constructor with reactor size (number of assemblies)
specified.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(ISFRComponentVisitor visitor)
Overrides the default behavior (ignore) from SFRComponent and implements
the accept operation for this SFRComponent's type.
|
boolean |
addAssembly(AssemblyType type,
SFRAssembly assembly)
Adds the specified assembly to the reactor core; returns true if the
operation was successful.
|
void |
addComponent(Component child)
An operation that overrides the SFRComposite's operation.
|
java.lang.Object |
clone()
Deep copies and returns a newly instantiated object.
|
void |
copy(SFReactor otherObject)
Deep copies the contents of the object.
|
boolean |
equals(java.lang.Object otherObject)
Overrides the equals operation to check the attributes on this object
with another object of the same type.
|
SFRComponent |
getAssemblyByLocation(AssemblyType type,
int row,
int column)
Returns the assembly of AssemblyType, at the specified (x, y)
coordinates.
|
SFRComponent |
getAssemblyByName(AssemblyType type,
java.lang.String name)
Returns the assembly of the specified type and name.
|
java.util.ArrayList<java.lang.Integer> |
getAssemblyLocations(AssemblyType type,
java.lang.String name)
Returns an ArrayList of locations within the reactor that are occupied by
the assembly matching the specified type and name.
|
java.util.ArrayList<java.lang.String> |
getAssemblyNames(AssemblyType type)
Returns a string ArrayList of the names of all assemblies of the
specified type.
|
double |
getLatticePitch()
Returns the lattice pitch (shortest distance between centers of adjacent
assemblies) as a double.
|
int |
getNumberOfAssemblies(AssemblyType type)
Returns the number of assemblies of AssemblyType in the reactor.
|
double |
getOuterFlatToFlat()
Returns the outer flat-to-flat distance as a double.
|
int |
getSize()
Returns the size (number of assemblies) of the reactor core.
|
int |
hashCode()
Returns the hashCode of the object.
|
boolean |
removeAssembly(AssemblyType type,
java.lang.String name)
Removes the specified assembly from the reactor core; returns true if the
operation was successful.
|
boolean |
removeAssemblyFromLocation(AssemblyType type,
int row,
int column)
Removes the assembly of AssemblyType, from the specified (x, y) location;
returns true if the operation was successful.
|
void |
removeComponent(int childId)
An operation that overrides the SFRComposite's operation.
|
void |
removeComponent(java.lang.String name)
An operation that overrides the SFRComposite's operation.
|
boolean |
setAssemblyLocation(AssemblyType type,
java.lang.String name,
int row,
int column)
Adds an assembly of the specified type and name to the reactor in the
specified location.
|
void |
setLatticePitch(double latticePitch)
Sets the lattice pitch.
|
void |
setOuterFlatToFlat(double outerFlatToFlat)
Sets the outer flat-to-flat distance.
|
copy, getComponent, getComponent, getComponentNames, getComponents, getNumberOfComponents
accept, addData, copy, getCurrentTime, getDataAtCurrentTime, getDescription, getFeatureList, getFeaturesAtCurrentTime, getId, getName, getNumberOfTimeSteps, getSourceInfo, getTimes, getTimeStep, getTimeUnits, notifyListeners, register, removeDataFromFeature, setDescription, setId, setName, setSourceInfo, setTime, setTimeUnits, toString, unregister, update
register, unregister, update
getDescription, getId, getName, setDescription, setId, setName
public SFReactor(int size)
Parameterized constructor with reactor size (number of assemblies) specified.
size
- Size of the reactor (number of assemblies).public int getSize()
Returns the size (number of assemblies) of the reactor core.
public void setLatticePitch(double latticePitch)
Sets the lattice pitch.
latticePitch
- The lattice pitch of the reactor. Must be positive.public double getLatticePitch()
Returns the lattice pitch (shortest distance between centers of adjacent assemblies) as a double.
public void setOuterFlatToFlat(double outerFlatToFlat)
Sets the outer flat-to-flat distance.
outerFlatToFlat
- The outer flat-to-flat distance. Must be positive.public double getOuterFlatToFlat()
Returns the outer flat-to-flat distance as a double.
public void addComponent(Component child)
An operation that overrides the SFRComposite's operation. This operation does nothing and requires that the appropriate, more defined, associated operation to be utilized on this class.
addComponent
in interface Composite
addComponent
in class SFRComposite
child
- The Component that should be added to the Composite.Composite.addComponent(Component child)
public void removeComponent(int childId)
An operation that overrides the SFRComposite's operation. This operation does nothing and requires that the appropriate, more defined, associated operation to be utilized on this class.
removeComponent
in interface Composite
removeComponent
in class SFRComposite
childId
- The ID of the child Component to remove.Composite.removeComponent(int childId)
public void removeComponent(java.lang.String name)
An operation that overrides the SFRComposite's operation. This operation does nothing and requires that the appropriate, more defined, associated operation to be utilized on this class.
removeComponent
in class SFRComposite
name
- The name of the child Component to remove.public boolean addAssembly(AssemblyType type, SFRAssembly assembly)
Adds the specified assembly to the reactor core; returns true if the operation was successful.
type
- The AssemblyType of assembly being added.assembly
- The assembly being added to the reactor.public boolean removeAssembly(AssemblyType type, java.lang.String name)
Removes the specified assembly from the reactor core; returns true if the operation was successful.
type
- The AssemblyType of the assembly being removed.name
- The name of the assembly being removed.public boolean removeAssemblyFromLocation(AssemblyType type, int row, int column)
Removes the assembly of AssemblyType, from the specified (x, y) location; returns true if the operation was successful.
type
- The AssemblyType of the assembly being removed.row
- The row in which the assembly to be removed is found in the
AssemblyType's GridManager.column
- The column in which the assembly to be removed is found in the
AssemblyType's GridManager.public int getNumberOfAssemblies(AssemblyType type)
Returns the number of assemblies of AssemblyType in the reactor.
type
- The AssemblyType being searched for.public java.util.ArrayList<java.lang.String> getAssemblyNames(AssemblyType type)
Returns a string ArrayList of the names of all assemblies of the specified type.
type
- The AssemblyType being searched for.public SFRComponent getAssemblyByName(AssemblyType type, java.lang.String name)
Returns the assembly of the specified type and name.
type
- The AssemblyType of the assembly being searched for.name
- The name of the assembly being searched for.public SFRComponent getAssemblyByLocation(AssemblyType type, int row, int column)
Returns the assembly of AssemblyType, at the specified (x, y) coordinates.
type
- The AssemblyType being searched for.row
- The row of the assembly in the AssemblyType GridManager.column
- The column of the assembly in the AssemblyType GridManager.public boolean setAssemblyLocation(AssemblyType type, java.lang.String name, int row, int column)
Adds an assembly of the specified type and name to the reactor in the specified location.
type
- The type of assembly that will be added.name
- The name of the assembly to set. The name must correspond to
an existing assembly.row
- The row in which to put the assembly.column
- The column in which to put the assembly.public java.util.ArrayList<java.lang.Integer> getAssemblyLocations(AssemblyType type, java.lang.String name)
Returns an ArrayList of locations within the reactor that are occupied by the assembly matching the specified type and name.
type
- The assembly type (fuel, control, reflector) of the assembly
being searched for.name
- The name of the assembly being searched for.public boolean equals(java.lang.Object otherObject)
Overrides the equals operation to check the attributes on this object with another object of the same type. Returns true if the objects are equal. False otherwise.
equals
in interface Identifiable
equals
in class SFRComposite
otherObject
- The object to be compared against.Identifiable.equals(Object otherObject)
public int hashCode()
Returns the hashCode of the object.
hashCode
in interface Identifiable
hashCode
in class SFRComposite
Identifiable.hashCode()
public void copy(SFReactor otherObject)
Deep copies the contents of the object.
otherObject
- The object to be copied from.public java.lang.Object clone()
Deep copies and returns a newly instantiated object.
clone
in interface Identifiable
clone
in class SFRComposite
public void accept(ISFRComponentVisitor visitor)
accept
in class SFRComponent
visitor
- An ISFRComponentVisitor that is visiting this SFRComponent.