设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14127|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 j. c; d+ D% \

/ f" r/ P8 x  P/ L1 L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ n% d2 Q+ T; U  F( h+ `  Q* m: b" s$ F4 O6 r+ M
begin P_read arriving  u5 u" }" H4 B2 B" q( d- Q
    while 1=1 do begin
1 Z. X1 u( n9 k' p, d% }        read A_tote from "data.txt" with delimiter "\n", [4 E7 u3 R! k/ C; A( @7 g
        read A_time from "data.txt" with delimiter "\n"
3 q2 {. J" A6 H/ \# t; Z  p        read A_leave from "data.txt" with delimiter "\n"2 f" K5 K( T( d% R3 S
        read A_picks from "data.txt" with delimiter "\n"
4 W1 D0 h1 \& f/ N6 o9 Z- y* ?        set load type to A_tote
9 ~! V/ ~; `8 C( w        if A_tote="tote 1" then set A_induct to 1
% P/ H1 ]) _- p! o+ h        else if A_tote="tote 2" then set A_induct to 2
) r1 T) o7 [& B, e. M3 }            else set A_induct to 3    . B5 O5 H$ g0 G+ m  K: y
        set A_i to 0  j9 t' C; Z. w' }8 p$ {
        clone 1 load to P_induction
* t2 ?$ U4 I% _. d2 a* b  R* Q        wait for A_time sec
7 z9 p. {2 ]# z: J& J    end- a/ H4 f6 G, U/ D5 g5 A
end
; T, p  n% H! C3 q+ e, L
. G+ S' {5 `: N" H6 s9 Tbegin P_induction arriving
1 w5 m: [! f# K- w& j0 T2 S( v% H    if A_induct=1 then clone 1 load to P_pick1- g7 \1 p) C9 W0 t
    else if A_induct=2 then clone 1 load to P_pick2) K+ V+ O1 c# L
        else clone 1 load to P_pick3+ F) w! D; J( h: X! I% b
end
+ R- \5 F' [9 u" M: @6 z4 g1 Z* m& L0 h
begin P_pick1 arriving
! D9 z4 F" B8 z; s6 Z    set A_i to 17 ~, g1 w/ S6 a- \" d$ U: U
    move into Q_induct1  q+ k+ l( ?- x( T7 K
    move into pickaisle.induct1
# Y+ m! a0 [5 C/ h+ ]% b' a) l3 y& k  K    while A_i<=30 do begin
3 |5 H6 T  A0 o) Q# e5 K9 l9 z        travel to pickaisle.con(A_i)4 r0 h1 x& D* Z& {* c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, j: U: a5 V! N( q% @
        else wait for 10 sec, g% B: h8 v1 K' R! q: ?
        if A_i=A_leave then send to die
/ ?7 Y9 ]4 n! C7 ^2 N% U        else inc A_i by 1
$ O" ^7 p; M% I% y3 z    end+ ?$ b( i+ b" E, M. w
end9 F+ R7 Q5 Q; Z, O5 G
3 y7 D" m- ?: _6 D4 ^. a
begin P_pick2 arriving
9 @$ [7 n1 x4 @: T* F+ ]  b) w    set A_i to 11
  R4 I+ r: W/ d" S) `    move into Q_induct2
9 _( R, s' [1 b0 J    move into pickaisle.induct2
3 U$ F/ U! g4 k8 u    while A_i<=30 do begin2 w( |+ s4 ?, t# H
        travel to pickaisle.con(A_i)$ c: _" k7 m2 C7 {6 j7 x9 m2 |  N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! J& @+ M  M: O5 h
        else wait for 10 sec
8 f0 f7 [1 T5 q6 F% _' v        if A_i=A_leave then send to die7 ]2 ]4 d" h+ j" M8 G8 R
        else inc A_i by 1
% L9 Q, h4 ]$ ^3 T    end
3 [; t) W" ^; |0 i4 P+ k: tend* c  L( C. J% ]' k3 R

, `! H2 M- o5 d4 fbegin P_pick3 arriving  m( k' e) i4 Y, \5 B/ v4 H5 L2 J
    set A_i to 21- O1 A  D( a- ]; u/ W7 K
    move into Q_induct3
+ _$ V9 w$ }2 s4 F    move into pickaisle.induct3$ U) n3 `. C6 c* l3 S
    while A_i<=30 do begin
4 ^% K7 q4 w; D/ w" S* P/ [* {        travel to pickaisle.con(A_i)6 \7 c3 b+ F2 t/ ]) v2 \& d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: R' h# T4 `6 `( N. S        else wait for 10 sec
/ q6 d. T3 w9 H' t; m        if A_i=A_leave then send to die( ~# O' D; E0 G8 k# u- z! L
        else inc A_i by 1* P2 C, ~) f5 h) O1 _* e( P0 q/ k
    end
% s. {+ Q; C( P3 y( j  ^. Qend

最佳答案

查看完整内容

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是个什么东东?
0 V5 d0 J% j0 h! o$ q8 M, U% Rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& I5 H. e( s: Z1 h/ R
; ]: r+ i* y" B% T# {' yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ ~% \7 ?( `  D* t3 }# b4 D4 s. |
- `7 j0 Y) R, S9 C1 E$ w另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 k2 Z8 V# Z3 y- j6 m) {$ X
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# `. K5 d/ F( {7 c6 P+ e' ?  K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% _2 r7 k6 F  g" K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 E4 `/ Y4 ~& }* d' y- b
begin P_induction arriving
( x3 f9 |7 b& a& t' [. E% Z, b    clone 1 load to P_pick(A_induct)
/ q! I' N5 D! \, T- U* ]1 wend最大的系, e4 O# l9 b. M" J( O: L: Z

" ~: p( |9 |/ z) \  e. Fbegin P_pick arriving
4 i8 Q9 ^6 T/ I' R, Z5 ~    set A_i to procindex * 10 + 1
, ^- d" q$ T3 s9 p0 w    move into Q_induct(procindex)8 ^  y2 d* M# w. r' |" U3 W6 A- ~, j
    move into pickaisle.induct(procindex)
. j9 P# l' P' ]9 b0 c    /*check the type of pickaisle.induct(i), for your last problem.*/
" V3 Z, J1 ~: T  j2 D) I  w
0 u; p- N0 d1 n2 p0 `% P) b    while A_i<=30 do begin
9 Z( K4 V' w; r. N        travel to pickaisle.con(A_i)
4 E) ?4 |: d  W) h8 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  w# m  j3 Z& ?) p        else wait for 10 sec! l- _- k) c0 g, U' g' r
        if A_i=A_leave then send to die& X; H$ K! o: Q
        else inc A_i by 1
& Q7 n/ X* U- R6 F    end
$ W8 [/ L9 p, o8 }end6 D# \  x4 q, X7 }$ P1 g
/ C2 w' \7 N, i; L  B  x
其中的procindex为整形,代表当前process的序号。
. [; m: `* V. r( ^, P4 L5 Tstation和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-6-11 23:25 , Processed in 0.014248 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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