Skip to content

Commit

Permalink
add expression/condition viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
tomooda committed Apr 3, 2024
1 parent d7fd6da commit e19256f
Show file tree
Hide file tree
Showing 70 changed files with 1,788 additions and 147 deletions.
12 changes: 12 additions & 0 deletions src/ReMobidyc-Language/RMDAgentDirectiveNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,23 @@ RMDAgentDirectiveNode >> agentIdentifier: aString [
agentIdentifier := aString
]

{ #category : #converting }
RMDAgentDirectiveNode >> asPresenter [

^ RMDAgentDirectivePresenter on: self
]

{ #category : #enumerating }
RMDAgentDirectiveNode >> childrenDo: aBlock [

]

{ #category : #accessing }
RMDAgentDirectiveNode >> directiveName [

^ self subclassResponsibility
]

{ #category : #comparing }
RMDAgentDirectiveNode >> hash [
^ self class hash bitXor: agentIdentifier hash
Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDApplyNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ RMDApplyNode >> arguments: anArrayOfRMDExpressionNode [
arguments := anArrayOfRMDExpressionNode
]

{ #category : #converting }
RMDApplyNode >> asPresenter [

^ RMDApplyExpressionPresenter on: self
]

{ #category : #enumerating }
RMDApplyNode >> childrenDo: aBlock [
arguments do: aBlock
Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDAreaDirectiveNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Class {
#category : #'ReMobidyc-Language-AST'
}

{ #category : #converting }
RMDAreaDirectiveNode >> asPresenter [

^ RMDAtomicDirectivePresenter on: self
]

{ #category : #testing }
RMDAreaDirectiveNode >> isAreaDirectiveNode [
^ true
Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDBinaryCombinatorNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ RMDBinaryCombinatorNode >> = anObject [
and: [ conditions = anObject conditions ]
]

{ #category : #converting }
RMDBinaryCombinatorNode >> asPresenter [

^ RMDBinaryCombinatorPresenter on: self
]

{ #category : #enumerating }
RMDBinaryCombinatorNode >> childrenDo: aBlock [
conditions do: aBlock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ RMDBinaryOperatorApplicationNode >> = anObject [
and: [ expression2 = anObject expression2 ] ]
]

{ #category : #converting }
RMDBinaryOperatorApplicationNode >> asPresenter [

^ RMDBinaryOperatorExpressionPresenter on: self
]

{ #category : #enumerating }
RMDBinaryOperatorApplicationNode >> childrenDo: aBlock [
aBlock
Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDBinaryRelationNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ RMDBinaryRelationNode >> = anObject [
and: [ expressions = anObject expressions ]
]

{ #category : #converting }
RMDBinaryRelationNode >> asPresenter [

^ RMDBinaryRelationPresenter on: self
]

{ #category : #enumerating }
RMDBinaryRelationNode >> childrenDo: aBlock [
expressions do: aBlock
Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDChanceNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ RMDChanceNode >> = anObject [
probability = anObject probability ]
]

{ #category : #converting }
RMDChanceNode >> asPresenter [

^ RMDChancePresenter on: self
]

{ #category : #enumerating }
RMDChanceNode >> childrenDo: aBlock [

Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDDeUnitExpressionNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Class {
#category : #'ReMobidyc-Language-AST'
}

{ #category : #converting }
RMDDeUnitExpressionNode >> asPresenter [

^ RMDDeUnitExpressionPresenter on: self
]

{ #category : #testing }
RMDDeUnitExpressionNode >> isDeUnitExpressionNode [

Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDDeltaTimeDirectiveNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Class {
#category : #'ReMobidyc-Language-AST'
}

{ #category : #converting }
RMDDeltaTimeDirectiveNode >> asPresenter [

^ RMDAtomicDirectivePresenter on: self
]

{ #category : #testing }
RMDDeltaTimeDirectiveNode >> isDeltaTimeDirectiveNode [
^ true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Class {
#category : #'ReMobidyc-Language-AST'
}

{ #category : #printing }
RMDDensityOfIndividualsInPatchDirectiveNode >> directiveName [

^ 'density of'
]

{ #category : #testing }
RMDDensityOfIndividualsInPatchDirectiveNode >> isDensityOfIndividualsInPatchDirective [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Class {
#category : #'ReMobidyc-Language-AST'
}

{ #category : #accessing }
RMDDensityOfIndividualsInRadiusDirectiveNode >> directiveName [

^ 'density of'
]

{ #category : #testing }
RMDDensityOfIndividualsInRadiusDirectiveNode >> isDensityOfIndividualsInRadiusDirective [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Class {
#category : #'ReMobidyc-Language-AST'
}

{ #category : #accessing }
RMDDensityOfIndividualsInWorldDirectiveNode >> directiveName [

^ 'density of'
]

{ #category : #testing }
RMDDensityOfIndividualsInWorldDirectiveNode >> isDensityOfIndividualsInWorldDirective [

Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDDirectionDirectiveNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ RMDDirectionDirectiveNode class >> agent: anotherString [
yourself
]

{ #category : #accessing }
RMDDirectionDirectiveNode >> directiveName [

^ 'direction'
]

{ #category : #testing }
RMDDirectionDirectiveNode >> isDirectionDirectiveNode [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ RMDDirectionOfGradientDirectiveNode >> = anObject [
patchAttributeVariable = anObject patchAttributeVariable ]
]

{ #category : #converting }
RMDDirectionOfGradientDirectiveNode >> asPresenter [

^ RMDDirectionOfGradientDirectivePresenter on: self
]

{ #category : #enumerating }
RMDDirectionOfGradientDirectiveNode >> childrenDo: aBlock [

Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDDistanceDirectiveNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ RMDDistanceDirectiveNode class >> agent: anotherString [
yourself
]

{ #category : #accessing }
RMDDistanceDirectiveNode >> directiveName [

^ 'distance'
]

{ #category : #testing }
RMDDistanceDirectiveNode >> isDistanceDirectiveNode [

Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDEnUnitExpressionNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Class {
#category : #'ReMobidyc-Language-AST'
}

{ #category : #converting }
RMDEnUnitExpressionNode >> asPresenter [

^ RMDEnUnitExpressionPresenter on: self
]

{ #category : #testing }
RMDEnUnitExpressionNode >> isEnUnitExpressionNode [

Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDExpressionNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ RMDExpressionNode >> / aRMDExpression [
^ RMDFractionNode expression: self expression: aRMDExpression
]

{ #category : #converting }
RMDExpressionNode >> asPresenter [

^ RMDAtomicExpressionPresenter on: self
]

{ #category : #private }
RMDExpressionNode >> insertTrace [

Expand Down
12 changes: 12 additions & 0 deletions src/ReMobidyc-Language/RMDGammaDistributionNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ RMDGammaDistributionNode >> childrenTransform: aBlock [
shapeExpression := aBlock value: shapeExpression
]

{ #category : #accessing }
RMDGammaDistributionNode >> distributionName [

^ 'gamma'
]

{ #category : #accessing }
RMDGammaDistributionNode >> gamma: aNumber in: aRMDInterpreter [

Expand All @@ -141,6 +147,12 @@ RMDGammaDistributionNode >> normalIn: aRMDInterpreter [
* (aRMDInterpreter random * Float pi * 2.0) cos
]

{ #category : #accessing }
RMDGammaDistributionNode >> parameter1Expression [

^ self shapeExpression
]

{ #category : #copying }
RMDGammaDistributionNode >> postCopy [

Expand Down
12 changes: 12 additions & 0 deletions src/ReMobidyc-Language/RMDGammaMeanDistributionNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ RMDGammaMeanDistributionNode >> meanExpression: aRMDExpressionNode [
meanExpression := aRMDExpressionNode
]

{ #category : #accessing }
RMDGammaMeanDistributionNode >> parameter2Expression [

^ self meanExpression
]

{ #category : #accessing }
RMDGammaMeanDistributionNode >> parameterName [

^ 'mean'
]

{ #category : #copying }
RMDGammaMeanDistributionNode >> postCopy [

Expand Down
12 changes: 12 additions & 0 deletions src/ReMobidyc-Language/RMDGammaRateDistributionNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ RMDGammaRateDistributionNode >> isGammaRateDistributionNode [
^ true
]

{ #category : #accessing }
RMDGammaRateDistributionNode >> parameter2Expression [

^ self rateExpression
]

{ #category : #accessing }
RMDGammaRateDistributionNode >> parameterName [

^ 'rate'
]

{ #category : #copying }
RMDGammaRateDistributionNode >> postCopy [

Expand Down
12 changes: 12 additions & 0 deletions src/ReMobidyc-Language/RMDGammaScaleDistributionNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ RMDGammaScaleDistributionNode >> isGammaScaleDistributionNode [
^ true
]

{ #category : #accessing }
RMDGammaScaleDistributionNode >> parameter2Expression [

^ self scaleExpression
]

{ #category : #accessing }
RMDGammaScaleDistributionNode >> parameterName [

^ 'scale'
]

{ #category : #copying }
RMDGammaScaleDistributionNode >> postCopy [

Expand Down
6 changes: 6 additions & 0 deletions src/ReMobidyc-Language/RMDGuardedChoiceNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ RMDGuardedChoiceNode >> = anObject [
and: [ guardsAndChoices = anObject guardsAndChoices ]
]

{ #category : #converting }
RMDGuardedChoiceNode >> asPresenter [

^ RMDGuardedChoicePresenter on: self
]

{ #category : #enumerating }
RMDGuardedChoiceNode >> childrenDo: aBlock [

Expand Down
18 changes: 18 additions & 0 deletions src/ReMobidyc-Language/RMDIndividualsInPatchDirectiveNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,36 @@ RMDIndividualsInPatchDirectiveNode >> animatName: aString [
animatName := aString
]

{ #category : #converting }
RMDIndividualsInPatchDirectiveNode >> asPresenter [

^ RMDIndividualsInLocationDirectivePresenter on: self
]

{ #category : #enumerating }
RMDIndividualsInPatchDirectiveNode >> childrenDo: aBlock [


]

{ #category : #accessing }
RMDIndividualsInPatchDirectiveNode >> directiveName [

^ self subclassResponsibility
]

{ #category : #comparing }
RMDIndividualsInPatchDirectiveNode >> hash [

^ self class hash bitXor: animatName hash
]

{ #category : #accessing }
RMDIndividualsInPatchDirectiveNode >> locationName [

^ 'here'
]

{ #category : #copying }
RMDIndividualsInPatchDirectiveNode >> postCopy [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ RMDIndividualsInRadiusDirectiveNode >> animatName: aString [
animatName := aString
]

{ #category : #converting }
RMDIndividualsInRadiusDirectiveNode >> asPresenter [

^ RMDIndividualsInRadiusDirectivePresenter on: self
]

{ #category : #accessing }
RMDIndividualsInRadiusDirectiveNode >> directiveName [

^ self subclassResponsibility
]

{ #category : #accessing }
RMDIndividualsInRadiusDirectiveNode >> locationName [

^ 'radius'
]

{ #category : #utilities }
RMDIndividualsInRadiusDirectiveNode >> numberOfIndividualsIn: aNumber with: aRMDInterpreter [

Expand Down
Loading

0 comments on commit e19256f

Please sign in to comment.