设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12712|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 c% e" Q0 w8 P/ l) w' V0 P; C8 x( h, A2 g
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 [+ l( N" Y6 M+ H

9 i% R2 c" O1 ]1 U" c% abegin P_read arriving
6 |. Q4 O/ u0 T2 u+ U' i    while 1=1 do begin
$ k) l* k% l/ R* E( e; g5 S        read A_tote from "data.txt" with delimiter "\n"
8 p& r& b: P5 S; N( m# `. |, U        read A_time from "data.txt" with delimiter "\n"
. j$ Y& R1 d2 k* w        read A_leave from "data.txt" with delimiter "\n"
3 z8 z1 C- |: X3 n        read A_picks from "data.txt" with delimiter "\n"* }2 S- b# Y! O  k* e. D
        set load type to A_tote$ A3 h! f& k3 f; J+ z1 R
        if A_tote="tote 1" then set A_induct to 1$ d& Y6 U6 a6 j2 j. i
        else if A_tote="tote 2" then set A_induct to 2
. @+ I1 \1 |+ r            else set A_induct to 3    , o* J  p9 T1 O7 Z/ L9 l0 `
        set A_i to 02 ^% K: `% |+ A  k
        clone 1 load to P_induction
9 n% i  [, o6 l$ F! z        wait for A_time sec/ I: I% F9 `% R' ^! v$ B- O" u, n
    end& J+ O/ E# s* k
end
6 U' M* D) h+ c+ p% }6 K
9 B2 v' R2 v. {* ]# hbegin P_induction arriving: u1 c1 `6 l9 [# b+ k" {, h
    if A_induct=1 then clone 1 load to P_pick1
- V8 w) s0 {/ j9 W    else if A_induct=2 then clone 1 load to P_pick2- Z' ]. Y+ V/ O! n( c
        else clone 1 load to P_pick3
7 @% A% Z( y  y3 x2 ^end# M- A$ L9 ?$ s$ ]7 L( Q' f

9 N8 \# c! e) g* U$ kbegin P_pick1 arriving
+ f. c7 V  t7 W( [! E    set A_i to 1
1 \4 c8 }8 J5 P8 V- X6 y: K* w1 ~9 C( N    move into Q_induct18 D) s' S) F7 i
    move into pickaisle.induct1
/ L  u; z. I) E) U' d+ {    while A_i<=30 do begin+ ]  q8 `# T) v; y( T4 _
        travel to pickaisle.con(A_i)5 B* f4 ~! \) ^- y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% a' ~1 Y% j" y2 w' c- r  R
        else wait for 10 sec
$ f# y6 j6 |: d7 k: x  ^; R- V        if A_i=A_leave then send to die$ r# ~) j) S. y+ U( N
        else inc A_i by 1
5 c: i& R; b2 [    end
6 q& j) ?7 s7 }% o+ Aend
9 v4 N( m: w/ M$ K0 d
5 x7 a' t  j0 o) `3 q, w$ @begin P_pick2 arriving
$ L8 c# o8 s$ t: C. d    set A_i to 11" k, x9 p% x7 x6 g, C  h4 v' i
    move into Q_induct2" T3 ^5 A2 X4 S4 x' _8 W
    move into pickaisle.induct2
( }2 ?" T0 v/ `* o; J3 r# o' p    while A_i<=30 do begin
" z9 @, g* Y- F9 L3 W        travel to pickaisle.con(A_i)+ i7 y& t" P# N! [, H, B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# Z0 C' ~' E" @) U
        else wait for 10 sec
' w8 w+ I3 ?$ h( c- B        if A_i=A_leave then send to die" |: J: N  [$ Y& v0 e
        else inc A_i by 1
6 @2 u" k! n  @# @+ p5 `    end
5 ^7 o/ Y7 e/ d0 O. Uend
# l; d" }' ?7 ^4 b
' j7 w4 j9 @) @7 a, Dbegin P_pick3 arriving
# B, S0 D% T, V    set A_i to 21/ A! j  F4 R& D! E( X
    move into Q_induct31 @  U6 l2 W9 j( y
    move into pickaisle.induct3
& b5 ~0 H$ S" i    while A_i<=30 do begin9 C# F6 U! |6 {7 k* F7 R
        travel to pickaisle.con(A_i)# t% |+ C% g9 N1 ^- z& k6 s" \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 C: R3 o- m8 k9 p
        else wait for 10 sec$ A; z& Q8 n; |/ G& J
        if A_i=A_leave then send to die
4 b! s# H* t$ `6 ?& {$ a' [% {        else inc A_i by 1
* g+ i- n) g6 P# D1 h    end
8 ]# H' ?, W; [' D1 h) Eend

最佳答案

查看完整内容

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是个什么东东?# L3 q+ N: k( o3 `8 L6 b2 q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% S* E, {* ?8 t5 X/ G3 B- p- _9 q+ D3 R( f1 n/ b! x5 p* A, b$ e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% n/ ~1 \0 c8 f& b# @. |
% u  t) @; F, y) D2 z7 T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) y4 d: z& }% h# s+ V& e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( D0 g0 d7 H% u  a& Y8 N9 l0 Z( K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( `, f9 f9 o+ t) ]! j" J3 f3 ]
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ Q% n5 h0 Z5 I" d, w4 V4 Kbegin P_induction arriving6 y  B2 [/ a' q; w  I! Y# ?
    clone 1 load to P_pick(A_induct)
& K- z1 {+ O9 p; L: fend最大的系# `) j1 I8 [+ L: w2 J
8 a& I$ K) Z7 H% s1 D& g
begin P_pick arriving
& \0 p) b: D5 m& g* W& o    set A_i to procindex * 10 + 1
" J! O& P! b% d    move into Q_induct(procindex)
. V  `$ k% t5 U    move into pickaisle.induct(procindex)
$ V6 s# j# |( }5 I2 s, N, R" n& C    /*check the type of pickaisle.induct(i), for your last problem.*/
1 W! j8 _0 _+ e  ^* e8 Y8 b# w, _$ }" v8 {
    while A_i<=30 do begin. v% j* i( G( _8 E6 R
        travel to pickaisle.con(A_i)! Y; Z) p* G4 r6 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' t; k# b  O/ s: [3 `, U8 a+ o        else wait for 10 sec
4 Z( w2 P; i& e5 j# ^) t        if A_i=A_leave then send to die1 z+ Y9 N0 t; j) u" P$ R- S
        else inc A_i by 19 d4 Y/ Y' v# f, e  V
    end. }+ Y! @' Z7 \# U
end
- y; c' E) Z% u/ ?2 E! ^  _2 U8 p$ U# v3 T
其中的procindex为整形,代表当前process的序号。
& M0 L* d: I: w, F, Z& bstation和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-2-13 06:37 , Processed in 0.017795 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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