Develop Biology
The language of life
|
#include <Wave.h>
Public Member Functions | |
Wave (Symmetry *symmetry=NULL) | |
virtual | ~Wave () |
virtual chemical::Atom * | AsAtom () |
virtual const chemical::Atom * | AsAtom () const |
virtual Wave * | AsWave () |
virtual const Wave * | AsWave () const |
virtual Code | Attenuate (const Wave *other) |
virtual Wave * | Clone () const |
virtual Wave * | Demodulate () |
virtual const Wave * | Demodulate () const |
virtual Code | Disattenuate (const Wave *other) |
virtual Properties | GetProperties () const |
virtual Wave * | Modulate (Wave *signal) |
virtual Wave * | operator* () |
virtual const Wave * | operator* () const |
virtual Wave * | operator* (Wave *signal) |
virtual void | operator+ (const Wave *other) |
virtual void | operator- (const Wave *other) |
virtual void | operator| (Symmetry *symmetry) |
virtual Code | Reify (Symmetry *symmetry) |
virtual Symmetry * | Spin () const |
Static Public Member Functions | |
static Properties | GetResonanceBetween (const Wave *wave, const Properties &properties) |
static Properties | GetResonanceBetween (const Wave *wave1, const Wave *wave2) |
static Properties | GetResonanceBetween (ConstWaves waves) |
Protected Attributes | |
Wave * | m_signal |
Symmetry * | m_symmetry |
A Wave is a base class for all Biology objects. Waves can be Periodic but do not have to be. By default, we assume Waves have no discernible frequency, amplitude, or any other Property. This is similar to a chaotic pattern or a wave modulated with enough signals that it becomes indiscernible from white noise / randomness. We do not / cannot make any assumptions about the ordering / pattern of a Wave at this level. Such Properties will only manifest in derived classes.
You should be able to upcast to Wave from any other class. Cloning a Wave should produce a functional fully derived class. This means that all diamond inheritance should be resolved by all children when calling Clone For downcasting to a derived class, you will need to use the chemical::Atom::Bond(...) methodology. See chemical/Atom.h for more info.
Waves may be Modulated to store additional signals and subsequently Demodulated in order to retrieve that original signal. In this way, any Wave can carry any other.
bio::physical::Wave::Wave | ( | Symmetry * | symmetry = NULL | ) |
Definition at line 32 of file Wave.cpp.
Referenced by Clone().
|
virtual |
Definition at line 45 of file Wave.cpp.
References BIO_SANITIZE_AT_SAFETY_LEVEL_2, and m_symmetry.
|
inlinevirtual |
For Downcasting. Because Wave cannot be virtually inherited and will likely become an ambiguous base, we commit a sin and provide a cheat. This method can be used to resolve any downcasting. For example: this->AsAtom()->As<Whatever>().
Definition at line 209 of file Wave.h.
Referenced by bio::chemical::UnorderedStructureInterface::ImportAll(), and bio::chemical::LinearMotif< CONTENT_TYPE >::InsertImplementation().
|
inlinevirtual |
For Downcasting. Because Wave cannot be virtually inherited and will likely become an ambiguous base, we commit a sin and provide a cheat. This method can be used to resolve any downcasting. For example: this->AsAtom()->As<Whatever>().
Definition at line 221 of file Wave.h.
|
inlinevirtual |
For Upcasting. Used for resolving ambiguous inheritance without the need to explicitly derive from Wave. NOTE: operator Wave*() and various perturbations fail to resolve ambiguous implicit upcasting.
Reimplemented in bio::physical::Class< T >, bio::physical::Class< Identifiable< StandardDimension > >, bio::physical::Class< Atom >, bio::physical::Class< ExcitationBase >, bio::physical::Class< ExcitationWithArgument< WAVE, RETURN, ARGUMENT > >, bio::physical::Class< ExcitationWithTwoArguments< WAVE, RETURN, ARGUMENT1, ARGUMENT2 > >, bio::physical::Class< ExcitationWithoutArgument< WAVE, RETURN > >, bio::physical::Class< Insertion >, bio::physical::Class< Localization >, bio::physical::Class< Writer >, bio::physical::Class< Filterable >, bio::physical::Class< Identifiable< DIMENSION > >, bio::physical::Class< Periodic >, bio::physical::Class< Quantum< T > >, bio::physical::Class< Identifiable< SymmetryType > >, and bio::physical::Class< ThreadedPeriodic >.
Definition at line 186 of file Wave.h.
|
inlinevirtual |
For Upcasting. Used for resolving ambiguous inheritance without the need to explicitly derive from Wave. NOTE: operator Wave*() and various perturbations fail to resolve ambiguous implicit upcasting.
Reimplemented in bio::physical::Class< T >, bio::physical::Class< Identifiable< StandardDimension > >, bio::physical::Class< Atom >, bio::physical::Class< ExcitationBase >, bio::physical::Class< ExcitationWithArgument< WAVE, RETURN, ARGUMENT > >, bio::physical::Class< ExcitationWithTwoArguments< WAVE, RETURN, ARGUMENT1, ARGUMENT2 > >, bio::physical::Class< ExcitationWithoutArgument< WAVE, RETURN > >, bio::physical::Class< Insertion >, bio::physical::Class< Localization >, bio::physical::Class< Writer >, bio::physical::Class< Filterable >, bio::physical::Class< Identifiable< DIMENSION > >, bio::physical::Class< Periodic >, bio::physical::Class< Quantum< T > >, bio::physical::Class< Identifiable< SymmetryType > >, and bio::physical::Class< ThreadedPeriodic >.
Definition at line 197 of file Wave.h.
|
virtual |
Moves other through *this, taking something from it. Used for += operator This is a nop unless implemented by children.
other |
Reimplemented in bio::chemical::LinearMotif< CONTENT_TYPE >, bio::chemical::LinearMotif< Organelle * >, bio::chemical::LinearMotif< genetic::Plasmid * >, bio::chemical::LinearMotif< Tissue * >, bio::chemical::LinearMotif< Organ * >, bio::chemical::LinearMotif< Cell * >, bio::chemical::LinearMotif< Substance * >, bio::chemical::LinearMotif< Symmetry * >, bio::chemical::LinearMotif< Plasmid * >, bio::chemical::LinearMotif< molecular::Protein * >, bio::chemical::LinearMotif< Gene * >, bio::chemical::LinearMotif< Surface * >, bio::chemical::LinearMotif< chemical::Reaction * >, bio::chemical::LinearMotif< Protein * >, bio::chemical::LinearMotif< Molecule * >, bio::chemical::LinearMotif< Organism * >, and bio::chemical::LinearMotif< cellular::OrganSystem * >.
Definition at line 81 of file Wave.cpp.
References bio::code::NotImplemented().
Referenced by bio::chemical::LinearMotif< CONTENT_TYPE >::Attenuate(), bio::chemical::Atom::Attenuate(), and operator+().
|
virtual |
Reimplemented in bio::physical::Class< T >, bio::physical::Class< Identifiable< StandardDimension > >, bio::physical::Class< Atom >, bio::physical::Class< ExcitationBase >, bio::physical::Class< ExcitationWithArgument< WAVE, RETURN, ARGUMENT > >, bio::physical::Class< ExcitationWithTwoArguments< WAVE, RETURN, ARGUMENT1, ARGUMENT2 > >, bio::physical::Class< ExcitationWithoutArgument< WAVE, RETURN > >, bio::physical::Class< Insertion >, bio::physical::Class< Localization >, bio::physical::Class< Writer >, bio::physical::Class< Filterable >, bio::physical::Class< Identifiable< DIMENSION > >, bio::physical::Class< Periodic >, bio::physical::Class< Quantum< T > >, bio::physical::Class< Identifiable< SymmetryType > >, and bio::physical::Class< ThreadedPeriodic >.
Definition at line 52 of file Wave.cpp.
References Wave().
Referenced by bio::physical::PerspectiveUtilities::Clone().
|
virtual |
Treats *this as a carrier wave.
Definition at line 99 of file Wave.cpp.
References m_signal.
Referenced by bio::chemical::Atom::Attenuate(), bio::chemical::Atom::Disattenuate(), and operator*().
|
virtual |
|
virtual |
Pulls other out of *this, maybe giving something back? The opposite of Attenuation. Used for -= operator. This is a nop unless implemented by children.
other |
Reimplemented in bio::chemical::LinearMotif< CONTENT_TYPE >, bio::chemical::LinearMotif< Organelle * >, bio::chemical::LinearMotif< genetic::Plasmid * >, bio::chemical::LinearMotif< Tissue * >, bio::chemical::LinearMotif< Organ * >, bio::chemical::LinearMotif< Cell * >, bio::chemical::LinearMotif< Substance * >, bio::chemical::LinearMotif< Symmetry * >, bio::chemical::LinearMotif< Plasmid * >, bio::chemical::LinearMotif< molecular::Protein * >, bio::chemical::LinearMotif< Gene * >, bio::chemical::LinearMotif< Surface * >, bio::chemical::LinearMotif< chemical::Reaction * >, bio::chemical::LinearMotif< Protein * >, bio::chemical::LinearMotif< Molecule * >, bio::chemical::LinearMotif< Organism * >, and bio::chemical::LinearMotif< cellular::OrganSystem * >.
Definition at line 86 of file Wave.cpp.
References bio::code::NotImplemented().
Referenced by bio::chemical::LinearMotif< CONTENT_TYPE >::Disattenuate(), bio::chemical::Atom::Disattenuate(), and operator-().
|
virtual |
Waves, depending on their behavior, can have different Properties. GetProperties can be used for determining how to downcast *this. The Properties returned dictate what a Wave can do and / or what can be done with one. If we treat Properties as fourier components of a waveform, we could restate GetProperties as GetPeriodicComponents. In this context, "what a wave can do" and "what can be done with a wave" can be expressed as "which systems resonate with the wave in question" or "which systems have comparable periodic components", which is true here as well: when 2 Waves have the same Properties (i.e. Resonate with each other) they can be treated the same in some regard (perhaps they are "numeric" and can be "added") and when 2 waves have comparable properties, they can interact with each other. It is up to you and other users of this framework to determine which Properties to use where. This is your space, so make use of it when you feel it's appropriate. NOTE: Waves do not actually have m_properties. This method MUST be implemented by children in order to work. If using any chemical::Class or beyond, this method will be implemented for you. See chemical/Class.h for more info.
Reimplemented in bio::cellular::PeakCarrierWave, bio::chemical::ExcitationBase, bio::chemical::ExcitationWithoutArgument< WAVE, RETURN >, bio::chemical::ExcitationWithArgument< WAVE, RETURN, ARGUMENT >, bio::chemical::ExcitationWithTwoArguments< WAVE, RETURN, ARGUMENT1, ARGUMENT2 >, and bio::physical::Periodic.
Definition at line 142 of file Wave.cpp.
References bio::Properties.
Referenced by GetResonanceBetween().
|
static |
Ease of use method for getting the Resonance between a Wave and a set of Properties
wave | |
properties |
Definition at line 148 of file Wave.cpp.
References GetProperties(), GetResonanceBetween(), and bio::Properties.
|
static |
Ease of use method for getting the Resonance between just 2 waves, rather than n.
wave1 | |
wave2 |
Definition at line 192 of file Wave.cpp.
References GetResonanceBetween().
|
static |
Check how (and if) 2 Waves Resonate with each other. Resonance is defined as a commonality between 2 or more Waves. This is a little bit more generic than real life resonance, which is strictly a measure of increased amplitude when 2 or more waves interact. Here, Waves interacting could mean an increase in aperiodic behavior, where no frequency has any single discernible change to it, or any number of other complex transformations.
waves |
Definition at line 209 of file Wave.cpp.
References BIO_SANITIZE, BIO_SANITIZE_AT_SAFETY_LEVEL_2, and bio::Properties.
Referenced by bio::chemical::LinearMotif< CONTENT_TYPE >::Attenuate(), bio::chemical::Atom::Attenuate(), bio::chemical::Atom::Disattenuate(), GetResonanceBetween(), bio::chemical::UnorderedStructureInterface::ImportAll(), and bio::chemical::LinearMotif< CONTENT_TYPE >::InsertImplementation().
This will overwrite any signal currently carried by *this.
Definition at line 91 of file Wave.cpp.
References m_signal.
Referenced by bio::cellular::PeakCarrierWave::PeakCarrierWave(), and operator*().
|
virtual |
Demodulate operator (i.e. not "dereference")
Definition at line 118 of file Wave.cpp.
References Demodulate().
|
virtual |
Demodulate operator (i.e. not "dereference")
Definition at line 123 of file Wave.cpp.
References Demodulate().
Modulate operator (i.e. not "multiply")
signal |
Definition at line 109 of file Wave.cpp.
References Modulate().
|
virtual |
Makes other interfere with *this. Attenuates other.
other |
Definition at line 128 of file Wave.cpp.
References Attenuate().
|
virtual |
Removes the interference of other from *this. Disattenuates other.
other |
Definition at line 135 of file Wave.cpp.
References Disattenuate().
|
virtual |
|
virtual |
Reifying a Wave takes a Symmetry and realizes it by copying the values supplied into *this. Will update m_symmetry to the Symmetry provided but do nothing else. You should override Reify to update the contents of *this from the given Symmetry. Calling the parent method after is optional. See Quantum.h for an example interface.
symmetry |
Reimplemented in bio::chemical::Atom, bio::molecular::Molecule, bio::molecular::Surface, bio::physical::Filterable, bio::physical::Periodic, and bio::physical::Quantum< T >.
Definition at line 64 of file Wave.cpp.
References bio::code::Success().
Referenced by operator|().
|
virtual |
Spinning a Wave produces a Symmetry. Waves can be Rotated about any number of Axes. Spinning a Wave along one dimension (one Axis) would be the equivalent of reflecting that Wave or, possibly, refracting, dispersing, or otherwise altering the wave (e.g. if the Axis acted like a prism, rather than a mirror). When a Wave is Spun around multiple dimensions, the resulting Symmetry and effected transformations may not fall under any single property characteristic of real waves. Thus we treat Waves more like particles with a discrete spin.
You can visualize this by imagining a triangle that is then folded over to produce a polygon. Reflecting a triangle about 1 axis generates a rectangle, 2 a square, 3 a hexagon, 4 an octagon, and so on (sides = 3 + fibonacci sequence, starting at 0). Though, in this system, Axes do not overlap, so 1/2 of the polygon is discarded, once n >= 2. In this way, Spin() generates a triangle and you decide the shape by specifying how many Axes to Rotate the Symmetry about.
You should override Spin to update m_symmetry, then return the parent method. See Quantum.h for an example interface.
Reimplemented in bio::chemical::Atom, bio::molecular::Molecule, bio::molecular::Surface, bio::physical::Filterable, bio::physical::Periodic, and bio::physical::Quantum< T >.
Definition at line 59 of file Wave.cpp.
References m_symmetry.
Referenced by bio::physical::Axis::operator|(), bio::physical::Filterable::Spin(), bio::physical::Periodic::Spin(), and bio::physical::Quantum< T >::Spin().
|
protected |
|
protected |
We cache our Symmetry here to avoid excessive new & deletes when Spinning & Reifying *this.
Definition at line 272 of file Wave.h.
Referenced by ~Wave(), bio::physical::Filterable::Spin(), bio::physical::Periodic::Spin(), bio::physical::Quantum< T >::Spin(), and Spin().