Robots
{
"semantic": {
"type": "robot",
"body": {
"type": "body",
"steps": []
}
},
"view": {
"frontside_width": 66,
"frontside_height": 110,
"frontside_left": 678,
"frontside_top": 64.1875,
"drag_x_offset": 30,
"drag_y_offset": 59.8125
},
"version": 1
}
Robots can be trained to work on the back of things.
To train a robot click on the thing to see its backside and drop the robot there.
The robot will remember what you do until you click on the Stop training button.
If you then click on the green flag
the robot will start working if he's happy with what he's got to work with.
{
"semantic": {
"type": "top_level",
"backside_widgets": [
{
"widget": {
"semantic": {
"type": "number",
"operator": "+",
"numerator": "1",
"denominator": "1",
"format": "improper_fraction",
"infinite_stack": true
},
"view": {
"frontside_width": 76,
"frontside_height": 55,
"frontside_left": 46,
"frontside_top": 39,
"backside_geometry": {
"x_scale": 1,
"y_scale": 1,
"original_width": 550,
"original_height": 200
}
},
"version": 1
}
}
]
},
"view": {
"background_color": "rgba(245, 240, 240, 0.941176)",
"frontside_width": 0,
"frontside_height": 0,
"backside_width": 679,
"backside_height": 321,
"backside_left": 8,
"backside_top": 185.1875,
"backside_geometry": {
"x_scale": 1,
"y_scale": 1,
"original_width": 1200,
"original_height": 475
},
"drag_x_offset": 212,
"drag_y_offset": 241.8125,
"backside": true
},
"version": 1
}
Let's train the robot to double numbers.
First click on the 1 and then drop the robot on the backside of the 1.
Then have the robot pick up a copy of the 1 (it makes a copy when dragged) and drop it on the 1.
That's all the robot needs to do so click on the Stop training button.
The robot is now trained that when he is working on a 1 to add together then 1 and a copy.
If you click the green flag you'll see an unhappy robot
because the number is now 2 and he wants to work only on number 1.
We can make him less fussy by using the vacuum to erase the 1 that he's thinking about so he's happy with any number.
{
"semantic": {
"type": "vacuum",
"mode": "erase"
},
"view": {
"frontside_width": 123,
"frontside_height": 45,
"frontside_left": 6,
"frontside_top": 6
},
"version": 1
}
Just pick up the vacuum and move it over the 1 on the backside of the robot and release.
Click the green flag again and watch what happens.
Clicking the stop sign on the back of the number will stop the robot.
Closing the backsides will speed things up very much.
You can stretch the doubling number to see it better.
Robot can be trained to millions of different things. Explore a few examples.
Running over and over again
When a robot does what he was trained to do he'll do it all over again so long as what he's working on still matches his conditions.
You can make a robot run just once by unchecking "When finished start again" on his backside advanced options area.
Making teams of robots
You can make a team of robots by dropping a robot on the backside of another robot where there is an area that says
"Drop a robot here who will try to run when I can't".
You can see this by clicking on the robot to see its backside and then the > button to see the advanced settings.
The first robot will let the next robot run if what he's working on doesn't match his conditions.
Controlling the speed that robots run
On the advanced settings part of a robot's backside is a pop-up menu after the question "What speed should I run at?".
"Original" will cause the robot to take as long for each step as it took when he was trained.
"Normal" is the default speed for taking steps.
You can also choose "slow", "very slow", "fast", or "very fast" to alter the default speed.
Unwatched robots running on the backside of something ignore this setting and always run as fast as they can.
Giving robots names
You can click on a robot and then on the > button to see the advanced settings.
You can edit his generated name but keep it short -- there isn't much room.
You can give a longer description that will be displayed when the mouse hovers over the robot.
This will be replaced by a work area containing 3 things: a number, the backside of a number, and the backside of a robot.
top level widget
{
"semantic": {
"type": "top_level",
"backside_widgets": [
{
"widget": {
"shared_widget_index": 0
}
},
{
"widget": {
"shared_widget_index": 0
},
"is_backside": true
},
{
"widget": {
"shared_widget_index": 1
},
"is_backside": true
}
]
},
"view": {
"background_color": "rgb(245, 240, 240)",
"backside_width": 1289,
"backside_height": 516,
"backside_left": 8,
"backside_top": 184.1875,
"backside": true,
"drag_x_offset": 532,
"drag_y_offset": 410.8125
},
"version": 1,
"shared_widgets": [
{
"semantic": {
"type": "number",
"operator": "+",
"numerator": "2",
"denominator": "1",
"format": "mixed_number",
"backside_widgets": [
{
"widget": {
"semantic": {
"type": "robot",
"frontside_conditions": {
"semantic": {
"type": "number",
"operator": "+",
"numerator": "1",
"denominator": "1",
"format": "mixed_number",
"erased": true
},
"view": {
"backside": false
},
"version": 1
},
"body": {
"type": "body",
"steps": [
{
"type": "robot_action",
"action_name": "pick up",
"path": {
"type": "path.to_resource",
"resource": {
"type": "number",
"operator": "+",
"numerator": "1",
"denominator": "1",
"format": "mixed_number",
"is_backside": true
}
},
"additional_info": {
"time": 2994
}
},
{
"type": "robot_action",
"action_name": "drop it on",
"path": {
"type": "path.to_entire_context"
},
"additional_info": {
"time": 1775
}
}
]
},
"name": "Add 1",
"description": "a robot that counts."
},
"view": {
"frontside_width": 66,
"frontside_height": 110,
"frontside_left": 29,
"frontside_top": 77,
"backside_width": 550,
"backside_height": 461,
"backside_left": 667,
"backside_top": 28.6875,
"advanced_settings_open": true,
"saved_width": 66,
"saved_height": 110,
"backside": false
},
"version": 1
}
}
]
},
"view": {
"frontside_width": 76,
"frontside_height": 55,
"frontside_left": 38,
"frontside_top": 19,
"backside_width": 550,
"backside_height": 200,
"backside_left": 40,
"backside_top": 110,
"saved_width": 76,
"saved_height": 55,
"backside": false
},
"version": 1
},
{
"semantic": {
"type": "robot",
"frontside_conditions": {
"semantic": {
"type": "number",
"operator": "+",
"numerator": "1",
"denominator": "1",
"format": "mixed_number",
"erased": true
},
"view": {
"backside": false
},
"version": 1
},
"body": {
"type": "body",
"steps": [
{
"type": "robot_action",
"action_name": "pick up",
"path": {
"type": "path.to_resource",
"resource": {
"type": "number",
"operator": "+",
"numerator": "1",
"denominator": "1",
"format": "mixed_number",
"is_backside": true
}
},
"additional_info": {
"time": 2994
}
},
{
"type": "robot_action",
"action_name": "drop it on",
"path": {
"type": "path.to_entire_context"
},
"additional_info": {
"time": 1775
}
}
]
},
"name": "Add 1",
"description": "a robot that counts."
},
"view": {
"frontside_width": 66,
"frontside_height": 110,
"frontside_left": 29,
"frontside_top": 77,
"backside_width": 550,
"backside_height": 461,
"backside_left": 667,
"backside_top": 28.6875,
"advanced_settings_open": true,
"saved_width": 66,
"saved_height": 110,
"backside": false
},
"version": 1
}
]
}
What are robots a metaphor for?
Robots are pieces of programs.
Each team of robots correspond to a conventional program that is roughly like this:
repeat forever
run the first robot in the team
define running a robot as
if context matches conditions of the current robot
do recorded actions of that robot
else if the reason the context doesn't match the conditions is because of an empty nest
wait until a bird brings something to that nest and then run this robot again
else if there is a next robot
run the next robot.
Every robot team is always doing this at the same time.
Or more accurately ToonTalk creates the illusion that they all are running at the same time
by switching between them in a small fraction of a second.
Return to ToonTalk manual home page