Skip to content

Instantly share code, notes, and snippets.



Last active May 29, 2020
What would you like to do?
Conceptual Model Formalism - Skateboard
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook MIT License, Copyright (C) Ken Webb, Fri May 29 2020 12:04:23 GMT-0400 (Eastern Daylight Time)-->
Title: Conceptual Model Formalism - Skateboard
InternalName: 939a0a84cee453e4786c4077e5aee942
My Notes
May 29, 2020
Jen has introduced the idea of formal conceptual models.
In this workbook, I will interpret her ideas, and use her Skateboard example.
I will produce a tentative Xholon implementation of Jen's initial formal conceptual model.
Start with Jen's concept of Objects:
Object Types (and Subtypes and Supertypes)
Object States
Object Attributes
Object Actions
Object Instances
And here is the Objects part of her Skateboard example:
Object Type: Skateboard
Object States: movement-state: rolling/not-rolling, operational-state: working/not-working
Object Attributes: location, size, weight, style, colour
Object Actions: Rolling
Object Instances: The skateboard that usually sits on Jen's porch
These models also have Actions and Relationships.
To run this model
To view or edit this model
() our Slack channel
Examples of use of DefaultContent:
Composing Micro-Behaviors
DefaultContent for behavior (script) nodes
Two avatars and a stick in a 1d gridcell cycle
DefaultContent for behavior (script) nodes
Programming with Categories (DRAFT) - 1.1 Programming: the art of composition
DefaultContent for behavior (script) nodes
Island Colorings
this workbook has examples of a script node inside the DefaultContent
<script>this.parent().mass = 9999;</script>
<Fruit maxClones="10" energy="10"/>
<JuicyBerry maxClones="10" energy="10"/>
<Stick maxClones="10" energy="0"/>
<Fruit><DefaultContent><_-.immovabledc><script>this.parent().mass = 1;</script></_-.immovabledc></DefaultContent></Fruit>
Examples of StateMachine:
RoomModel DefaultContent 01
<State roleName="Top">
<TransitionExternal roleName="init">
<Activity roleName="1">
<Target roleName="ready"/>
<State roleName="ready">
<!-- Object Types (in Xholon, these can be Xholon Classes that are part of the Inheritance Hierarchy) -->
<Skateboard/> <!-- Skateboard is a Subtype of Vehicle -->
<MotorizedSkateboard superClass="Skateboard"/> <!-- Skateboard is a Supertype of MotorizedSkateboard -->
<script>this.parent().mass = 9999;</script>
<Fruit maxClones="10" energy="10"/>
<JuicyBerry maxClones="10" energy="10"/>
<Stick maxClones="10" energy="0"/>
<Fruit><DefaultContent><![CDATA[<_-.immovabledc><script>this.parent().mass = 1;</script></_-.immovabledc>]]></DefaultContent></Fruit>
<!-- TODO declare the Object States, Object Attributes, and Object Actions that Object Instances are allowed to have, and provide default values for all Skateboard instances -->
const skbd = this.parent();
this.println("Skateboard TESTING dc " +;
// declare and initialize Object Attributes
skbd.location = "LOCATION";
skbd.size = -1;
skbd.weight = -1; = "STYLE";
skbd.colour = "COLOUR";
<!-- Object States -->
<State roleName="Top">
<TransitionExternal roleName="init">
<Activity roleName="1Rolling">
<Target roleName="movement"/>
<State roleName="movement">
<State roleName="rolling"/>
<State roleName="not-rolling"/>
<State roleName="operational">
<State roleName="working"/>
<State roleName="not-working"/>
<!-- State Machine -->
<State xhType="XhtypeStateMachineEntityActive" implName="org.primordion.xholon.base.ObservableStateMachineEntity"/>
<PseudostateInitial xhType="XhtypeStateMachineEntityActive" implName="org.primordion.xholon.base.StateMachineEntity"/>
<PseudostateChoice xhType="XhtypeStateMachineEntityActive" implName="org.primordion.xholon.base.StateMachineEntity"/>
<Transition xhType="XhtypeStateMachineEntityActive" implName="org.primordion.xholon.base.StateMachineEntity"/>
<StateMachineEntity xhType="XhtypeStateMachineEntity" implName="org.primordion.xholon.base.StateMachineEntity"/>
<!-- see Xml2Xholon - DefaultContent only works if I include RoomModel somewhere before I need to use DefaultContent -->
<!-- Object Instances
how do I replace the default location, size, etc. ?
<Skateboard roleName="The skateboard that usually sits on Jen's porch" location="Ottawa" size="22"/>
<Skateboard roleName="The other pink polka-dotted skateboard" size="33"/>
<!-- this results in
<GreenTree mass="9999">
<Fruit maxClones="10" energy="10" mass="1"></Fruit>
<JuicyBerry maxClones="10" energy="10"></JuicyBerry>
<Stick maxClones="10" energy="0"></Stick>
<Skateboardbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var topActor;
var beh = {
postConfigure: function() {
topActor = this.cnode.parent();
processReceivedMessage: function(msg) {
if (topActor.first()) {
topActor.first().call(msg.signal,, msg.sender);
performActivity: function(activityId, msg) {
// perhaps these are Jen's Object Actions?
switch (activityId) {
case 1: // TODO put name of source state here
topActor.println("topActor is performing activity " + activityId + ", in response to msg " + msg);
//# sourceURL=Skateboardbehavior.js
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="">
<rect id="PhysicalSystem/Skateboard" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<rect id="PhysicalSystem/Skateboard[2]" fill="#6AB06A" height="50" width="10" x="80" y="0"/>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.