设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15482|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 J# I6 i* C0 H2 W3 ~
$ j0 _% T/ o& q; Z! @# q( N8 C5 I6 B
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
5 C- `0 [- ~5 K8 e. N
- X6 z- @1 Z8 P/ \/ Nbegin P_read arriving
$ g5 F! D' J% d; ?5 X" f  q    while 1=1 do begin
: ]- N0 C, N6 k$ M1 H        read A_tote from "data.txt" with delimiter "\n"
+ V' a0 {$ m8 }* G& z, I& W        read A_time from "data.txt" with delimiter "\n"$ [# H* N. [8 t# @) L. k2 R# G
        read A_leave from "data.txt" with delimiter "\n"
$ U/ i* g. b0 n8 G9 r& R3 D8 }        read A_picks from "data.txt" with delimiter "\n"
) p) J) d/ [0 P: z# h  G# n        set load type to A_tote
$ Z. m6 A; E' ?" `0 w/ g/ a        if A_tote="tote 1" then set A_induct to 1
2 m% C4 d9 Q$ |        else if A_tote="tote 2" then set A_induct to 2& \! V+ _3 c; Y9 n* U$ S! W
            else set A_induct to 3    7 `9 j7 N. I: l1 ^; H0 [) ^
        set A_i to 0
7 n; E# D. q2 q  Q& ]        clone 1 load to P_induction
$ S# {  N0 V; V2 X0 v) G) ]) Y) ^' ]        wait for A_time sec* D0 D, G4 M0 u; c9 I
    end  x# C/ P; r% D+ ]9 N# N" k
end
9 F! N. `9 l  N/ B/ C9 l1 y5 t5 \8 q( }1 S* \* ]
begin P_induction arriving( Y& {) o0 G; q/ @
    if A_induct=1 then clone 1 load to P_pick18 B5 V" h# O& @5 n* L8 D) t- {
    else if A_induct=2 then clone 1 load to P_pick2& \1 A3 @$ i$ T# f8 w. G: C0 U& i- R0 M
        else clone 1 load to P_pick3
: ~$ T6 S/ R+ s2 zend, q! h* S9 n  Z6 N

0 U9 X7 D, n5 O) ybegin P_pick1 arriving! R: F( x* b3 B9 H3 X
    set A_i to 1* I, s8 M' b1 h8 }, w
    move into Q_induct1# }6 \% k* `) s/ O) p% y8 {9 B
    move into pickaisle.induct1
; Z- t. r7 K3 h/ W- p2 ?    while A_i<=30 do begin  i- e& `0 J4 S! U3 ?4 b* v
        travel to pickaisle.con(A_i)
0 ?0 |  \( [  K* Q; M2 v; G7 `8 ~6 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( k: n$ N% l3 p2 i" z" w
        else wait for 10 sec$ K/ a) v* Q5 b6 S
        if A_i=A_leave then send to die) P% t5 d5 g! u
        else inc A_i by 1
% o, r! F. g' \+ v    end5 `3 \- b& d( R+ }# K
end
9 |: f& Z( F% B3 ?
" X$ f1 v9 T/ X" rbegin P_pick2 arriving
3 z: `9 G( ^" l; T7 L7 i    set A_i to 111 h+ M# S& N" L1 }6 V$ a4 K
    move into Q_induct26 q5 `6 [- B# Q3 F
    move into pickaisle.induct22 g2 r3 t/ |7 y% a8 R
    while A_i<=30 do begin& r+ s2 k$ ^4 ]- E
        travel to pickaisle.con(A_i)6 }9 B" Z$ l# Y: f) I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  I, s  a# P5 S+ n        else wait for 10 sec4 n1 ~2 F2 X5 m# C; D
        if A_i=A_leave then send to die. K9 n  H$ u: v: V0 F
        else inc A_i by 15 U* \! L" I6 m; r1 K& i
    end
! G) n4 ^! z7 r' N& F3 ^end& t& |+ w( V9 i& i% n
8 A) u" g( w9 {- j* F
begin P_pick3 arriving* a5 w& r; f# K9 T/ i1 c# Z4 k
    set A_i to 213 J' @7 c: [* g
    move into Q_induct3
5 v/ l% G/ F9 K! m" g( `. ]    move into pickaisle.induct3
6 r* b6 _/ }: G5 g6 y    while A_i<=30 do begin
! S  ^9 o* l! q* x, [. b% u: ?        travel to pickaisle.con(A_i)
- \) N/ k( V* w. Y9 L8 i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' F) R& \- N$ i$ g
        else wait for 10 sec1 D8 Y4 J, {1 d) @- i- P9 f% U
        if A_i=A_leave then send to die" y  n, ]6 W( ?9 U( K* `4 K
        else inc A_i by 1% I. V8 d5 T- j: e4 e6 B; M
    end. s) j; p- M2 L1 S5 j
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?. J) ~7 s* y& q- g" v
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 g1 y3 G- b  v$ O
1 F' C% ~- ?/ {) k6 [' I
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 j* @* N; W( |% Q( x" ]/ O7 Y* v' W$ u: b- H3 e1 @8 r; q0 n
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 Q9 H+ l6 w3 h6 v+ i' |1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 u! k) J) H# _+ n" Q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 s! h5 z) i( l8 l* a3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 N% p, Q: Z7 [begin P_induction arriving3 p4 V8 j0 m0 G% L5 Y" U9 X5 y4 h
    clone 1 load to P_pick(A_induct)
/ z( n/ t: ]$ O4 u4 P" Fend最大的系6 j- c* K! b6 f4 L& m. D) v6 O5 g

8 m1 q8 L  A; B* j) e& Rbegin P_pick arriving) f: Z$ P* e! J2 D
    set A_i to procindex * 10 + 1
- S! T" F5 q' Y( b0 J' D    move into Q_induct(procindex)- i3 w  p. X3 a8 W
    move into pickaisle.induct(procindex). r1 o! `: H- l3 D; U3 e- l: V
    /*check the type of pickaisle.induct(i), for your last problem.*/
! Q( |& \! E% H/ P
7 I+ `: h4 _" {0 L8 @7 y) N% v    while A_i<=30 do begin& ~2 c/ ?% O4 ^, D. X1 u8 Z7 G
        travel to pickaisle.con(A_i)
. o# s$ F; S; q/ P  o5 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- @3 G7 G( j+ {# L
        else wait for 10 sec
& C& f' g0 L" A& c* D+ @7 l4 }        if A_i=A_leave then send to die/ R3 A+ v, C  \9 S7 y6 J
        else inc A_i by 17 u, o, ^: _# g1 t8 v2 j' G
    end
4 K: J  m+ c" |0 y- q; b' J' j4 Hend, [( R; A4 ^6 q3 z' l+ d8 R
: d/ t% D7 `0 R9 R9 m
其中的procindex为整形,代表当前process的序号。
9 H2 [& O, W1 W) N9 k7 [8 pstation和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-9-14 05:08 , Processed in 0.019877 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表