-
Notifications
You must be signed in to change notification settings - Fork 1
/
abm_grid_copy_agents.sthlp
115 lines (88 loc) · 3.75 KB
/
abm_grid_copy_agents.sthlp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{smcl}
{* *! version 0.1.0 29Mar2019 MLB}{...}
{vieweralsosee "help abm_grid" "help abm_grid"}{...}
{vieweralsosee "help abm_grid_copy_agent" "help abm_grid_copy_agent"}{...}
{p2colset 1 18 20 2}{...}
{p2col:{bf:copy_agents()} {hline 2}}copy all agents from one location to another.
{p_end}
{p2colreset}{...}
{marker syntax}{...}
{title:Syntax}
{p 8 12 2}
{it:void}
{cmd:copy_agents(}{it:real scalar ro}, {it:real scalar co},
{it:real scalar rd}, {it:real scalar cd}{cmd:)}
{p 8 12 2}
{it:void}
{cmd:copy_agents(}{it:real scalar ro}, {it:real scalar co},
{it:real scalar rd}, {it:real scalar cd}, {it:real scalar t}{cmd:)}
{p 8 12 2}
{it:void}
{cmd:copy_agents(}{it:real scalar ro}, {it:real scalar co},
{it:real scalar rd}, {it:real scalar cd}, {it:real scalar to},
{it:real scalar td}{cmd:)}
{marker description}{...}
{title:Description}
{p 4 4 2}
{cmd:copy_agents()} copies all agents from one coordinate to another coordinate.
Copying an agent means that the {it:agent_id} is copied to the other coordinate.
The agent id is not removed from the original coordinate. The coordinate depends
on how the grid has been set up:
{pmore}
The coordinates consists of the row ({it:ro}) and column number ({it:co}) for the
origin and the row ({it:rd}) and column number ({it:cd}) for the destination if
{cmd:tdim} has been set to 0, or not set at all and {cmd:idim} has been set to 1
or not set at all.
{pmore}
The coordinates consists of the row ({it:ro}), column ({it:co}), and iteration
({it:to}) number for the origin and the row ({it:rd}), column ({it:cd}), and
iteration ({it:td}) number for the destination if {cmd:tdim} has been set to a
number larger than 0 and {cmd:idim} has been set to 1 or not set at all. If only
one iteration number is specified, then that iteration number will be used for
both the origin and the destination.
{title:Remarks}
{p 4 4 2}
{help abm_grid_copy_agent:copy_agent()} will be slightly faster if only one
agent per cell is allowed, that is {help abm_grid_rdim:idim()} has been set to
1 or not set at all.
{marker conformability}{...}
{title:Conformability}
{cmd:copy_agents(}{it:ro}, {it:co}, {it:rd}, {it:cd}{cmd:)}:
{it:result}: {it:void}
{it:ro}: 1 {it:x} 1
{it:co}: 1 {it:x} 1
{it:rd}: 1 {it:x} 1
{it:cd}: 1 {it:x} 1
{cmd:copy_agents(}{it:ro}, {it:co}, {it:rd}, {it:cd}, {it:t}{cmd:)}:
{it:result}: {it:void}
{it:ro}: 1 {it:x} 1
{it:co}: 1 {it:x} 1
{it:rd}: 1 {it:x} 1
{it:cd}: 1 {it:x} 1
{it:t}: 1 {it:x} 1
{cmd:copy_agents(}{it:ro}, {it:co}, {it:rd}, {it:cd}, {it:to}, {it:td}{cmd:)}:
{it:result}: {it:void}
{it:ro}: 1 {it:x} 1
{it:co}: 1 {it:x} 1
{it:rd}: 1 {it:x} 1
{it:cd}: 1 {it:x} 1
{it:to}: 1 {it:x} 1
{it:td}: 1 {it:x} 1
{marker diagnostics}{...}
{title:Diagnostics}
{p 4 4 2}
{cmd:copy_agents()} aborts with an error if {help abm_grid_setup:setup()} has not
been run first.
{p 4 4 2}
{cmd:copy_agents()} aborts with an error if the destination already contains an
agent.
{p 4 4 2}
{cmd:copy_agents()} aborts with an error if {it:ro}, {it:rd}, {it:co} or
{it:cd} is not an integer, or is less than or equal to 0, or is more than
{help abm_grid_rdim:rdim}, and {help abm_grid_rdim:cdim} respectively.
{p 4 4 2}
{cmd:copy_agents()} aborts with an error if {it:t}, {it:to}, or {it:td} is not an
integer, or is less 0, or is more than {help abm_grid_rdim:tdim}.
{p 4 4 2}
{cmd:copy_agents()} aborts with an error if {it:t}, {it:to}, or {it:td} has been
specified while {help abm_grid_rdim:tdim} has been set to 0.