class StructuredLexicon extends Lexicon
A special type of Lexicon where signals and referents are represented by binary strings. Signal-referent relations are based on a measure of representational similarity.
- Annotations
- @SerialVersionUID()
- Alphabetic
- By Inheritance
- StructuredLexicon
- Lexicon
- Product
- Equals
- Serializable
- Serializable
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
StructuredLexicon(vocabularyRepresentations: Vector[Vector[Boolean]], contextRepresentations: Vector[Vector[Boolean]], mappingFunction: StructuredMappingFunction, data: Vector[Double], mappingThreshold: Option[Double] = None)
- vocabularyRepresentations
A vector containing binary string representations of the signals in the vocabulary.
- contextRepresentations
A vector containing binary string representations of the referents in the context.
- mappingFunction
A function that takes two binary string representations and computes the relationship between them.
- data
A 1-dimensional vector representing the relations between the vocabulary and context.
- mappingThreshold
Optionally, for binary lexicons this specifies that when
mappingFunction>= mappingThreshold, there is a 1.0-value relationship or 0.0 otherwise.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from StructuredLexicon to any2stringadd[StructuredLexicon] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (StructuredLexicon, B)
- Implicit
- This member is added by an implicit conversion from StructuredLexicon to ArrowAssoc[StructuredLexicon] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
additiveBinaryMutation(additionRate: Double): Lexicon
Returns a copy of this lexicon where, based on
additionRate, a number of positive signal-referent relations of weight 1.0 will be added to the lexicon.Returns a copy of this lexicon where, based on
additionRate, a number of positive signal-referent relations of weight 1.0 will be added to the lexicon.- additionRate
The ratio of 0-valued signal-referent mappings that will be converted to 1.0 (from 0 to 1).
- Definition Classes
- Lexicon
-
def
apply(i: Int, j: Int): Double
Returns the relation value for signal
iand referentj.Returns the relation value for signal
iand referentj.- i
Index of the signal.
- j
Index of the referent.
- Definition Classes
- Lexicon
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asymmetryWith(that: Lexicon, similarity: Double = 0): Double
Returns the asymmetry between this lexicon and that lexicon.
Returns the asymmetry between this lexicon and that lexicon. Asymmetry is computed relative to the similarity threshold, i.e., it is the mean number of signal-referent relations that are more than similarity-value apart.
- that
The other lexicon against which asymmetry is computed.
- similarity
Optional argument specifying the threshold within which a signal-referent relation is considered 'same'.
- returns
The asymmetry between this and that.
- Definition Classes
- Lexicon
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- val contextRepresentations: Vector[Vector[Boolean]]
-
val
contextSize: Int
- Definition Classes
- Lexicon
-
val
data: Vector[Double]
- Definition Classes
- StructuredLexicon → Lexicon
-
def
dot(vector: Vector[Double]): Vector[Double]
Computes the dot product between the graded lexicon and a vector of length
contextSize.Computes the dot product between the graded lexicon and a vector of length
contextSize.- vector
A vector of length
contextSize.- returns
A vector of length
vocabularySizewith the dot product.
- Definition Classes
- Lexicon
- Exceptions thrown
scala.IllegalArgumentExceptionwhenvector.lengthis not equal tocontextSizeof this lexicon.
-
def
dotT(vector: Vector[Double]): Vector[Double]
Computes the dot product between the transposed graded lexicon and a vector of
vocabularySize.Computes the dot product between the transposed graded lexicon and a vector of
vocabularySize.- vector
A vector of length
vocabularySize.- returns
A vector of length
contextSizewith the dot product.
- Definition Classes
- Lexicon
- Exceptions thrown
scala.IllegalArgumentExceptionwhenvector.lengthis not equal tovocabularySizeof this lexicon.
-
def
ensuring(cond: (StructuredLexicon) ⇒ Boolean, msg: ⇒ Any): StructuredLexicon
- Implicit
- This member is added by an implicit conversion from StructuredLexicon to Ensuring[StructuredLexicon] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (StructuredLexicon) ⇒ Boolean): StructuredLexicon
- Implicit
- This member is added by an implicit conversion from StructuredLexicon to Ensuring[StructuredLexicon] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): StructuredLexicon
- Implicit
- This member is added by an implicit conversion from StructuredLexicon to Ensuring[StructuredLexicon] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): StructuredLexicon
- Implicit
- This member is added by an implicit conversion from StructuredLexicon to Ensuring[StructuredLexicon] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from StructuredLexicon to StringFormat[StructuredLexicon] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getColumn(j: Int): Vector[Double]
Returns the column for referent
j, containing all mapping values between referentjand all signals.Returns the column for referent
j, containing all mapping values between referentjand all signals. This function is of quadratic time complexity, use sparingly.- Definition Classes
- Lexicon
-
def
getLexicon: Lexicon
This function removed all information about the underlying representations in the structured lexicon.
This function removed all information about the underlying representations in the structured lexicon.
- returns
A default graded lexicon representation of the structured lexicon.
-
def
getRow(i: Int): Vector[Double]
Returns the row for signal
i, containing all mapping values between signaliand all referents.Returns the row for signal
i, containing all mapping values between signaliand all referents.- Definition Classes
- Lexicon
-
def
isConsistent: Boolean
- Definition Classes
- Lexicon
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
listenerDefinition: (Lexicon, Int) ⇒ Lexicon
- Definition Classes
- Lexicon
- val mappingFunction: StructuredMappingFunction
- val mappingThreshold: Option[Double]
-
def
meanAmbiguity(threshold: Double = 1): Double
Returns the mean ambiguity of this graded lexicon, where ambiguity is defined as the mean number of referents for which signals have a relation higher than the threshold.
Returns the mean ambiguity of this graded lexicon, where ambiguity is defined as the mean number of referents for which signals have a relation higher than the threshold.
- threshold
Optional parameter specifying the threshold within which a signal-referent relation is considered relevant.
- Definition Classes
- Lexicon
-
def
meanAndVarianceAmbiguity(threshold: Double = 1): (Double, Double)
Returns a tuple containing the mean (._1) and variance (._2) ambiguity of this graded lexicon.
Returns a tuple containing the mean (._1) and variance (._2) ambiguity of this graded lexicon. Ambiguity is defined as the mean number of referents for which signals have a relation higher than the threshold.
- threshold
Optional parameter specifying the threshold within which a signal-referent relation is considered relevant.
- Definition Classes
- Lexicon
-
def
mixReferents(mixRate: Double): Lexicon
Returns an immutable copy of this lexicon where, based on the
swapRate, signal-referent relations are swapped around with across the mapping's central axis.Returns an immutable copy of this lexicon where, based on the
swapRate, signal-referent relations are swapped around with across the mapping's central axis. That is, if swapped,(i)(j)and(i)(contextSize - j)are swapped.- mixRate
The rate at which referents are swapped.
- returns
A referent-swapped signal-referent mapping.
- Definition Classes
- Lexicon
-
def
mutate(mutationRate: Double): Lexicon
Returns a mutated (but immutable) copy of this lexicon.
Returns a mutated (but immutable) copy of this lexicon. Each word-referent relationship with graded value v has probability
P(mutationRate)of flipping according toMath.abs(v-1). In binary lexicons, a 1 flips to a 0 and vice versa. In graded lexicons a 0.9 flips to a 0.1 and vice versa. This is a non-deterministic transformation.- mutationRate
The probability of a word-referent mapping flipping.
- returns
A mutated (but immutable) mapping.
- Definition Classes
- Lexicon
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
normalizeColumns(): Lexicon
Returns a normalization of this lexicon across columns (i.e., divides each cell by the sum of its column).
Returns a normalization of this lexicon across columns (i.e., divides each cell by the sum of its column).
- Definition Classes
- Lexicon
-
def
normalizeRows(): Lexicon
Returns a normalization of this lexicon across rows (i.e., divides each cell by the sum of its row).
Returns a normalization of this lexicon across rows (i.e., divides each cell by the sum of its row).
- Definition Classes
- Lexicon
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
removalBinaryMutation(removalRate: Double, threshold: Double = 1): Lexicon
Returns a copy of this lexicon where, based on
additionRate, a number signal-referent relations of weight >thresholdwill be removed to the lexicon.Returns a copy of this lexicon where, based on
additionRate, a number signal-referent relations of weight >thresholdwill be removed to the lexicon.- removalRate
The ratio of 0-valued signal-referent mappings that will be converted to 1.0 (from 0 to 1).
- threshold
Optional parameter specifying the threshold above which relations can be removed.
- Definition Classes
- Lexicon
- val representationLength: Int
-
def
setOrderAsListener(n: Int): Lexicon
Returns a transformation of this lexicon corresponding to a
nth order listener as defined by the Rational Speech Act model.Returns a transformation of this lexicon corresponding to a
nth order listener as defined by the Rational Speech Act model.- n
The order of pragmatic reasoning.
- Definition Classes
- Lexicon
-
def
setOrderAsSpeaker(n: Int): Lexicon
Returns a transformation of this lexicon corresponding to a
nth order speaker as defined by the Rational Speech Act model.Returns a transformation of this lexicon corresponding to a
nth order speaker as defined by the Rational Speech Act model.- n
The order of pragmatic reasoning.
- Definition Classes
- Lexicon
-
val
speakerDefinition: (Lexicon, Int) ⇒ Lexicon
- Definition Classes
- Lexicon
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
to2DVector: Vector[Vector[Double]]
Returns a 2-dimensional vector representation of the lexicon.
Returns a 2-dimensional vector representation of the lexicon. Inefficient function, avoid usage.
- Definition Classes
- Lexicon
-
def
toString(): String
Returns a multi-line formatted string representation of the lexicon.
Returns a multi-line formatted string representation of the lexicon.
- Definition Classes
- Lexicon → AnyRef → Any
-
def
update(i: Int, j: Int, v: Double): Lexicon
Returns a new immutable lexicon with the relation between signal i and referent j updated to value v.
Returns a new immutable lexicon with the relation between signal i and referent j updated to value v.
- Definition Classes
- Lexicon
- val vocabularyRepresentations: Vector[Vector[Boolean]]
-
val
vocabularySize: Int
- Definition Classes
- Lexicon
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
→[B](y: B): (StructuredLexicon, B)
- Implicit
- This member is added by an implicit conversion from StructuredLexicon to ArrowAssoc[StructuredLexicon] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
Language Agents Simulation framework
For detailed documentation on using the framework please see the README.md file at the Github repository at https://github.com/markblokpoel/lanag-core.