设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11808|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 H/ t1 K% H1 J2 h
* c" V3 v) x; B/ B6 K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' d% g. a: ?* G1 U0 h
" n3 I. V- A, C1 m
begin P_read arriving
0 m% e, ?( |  F' e: r4 v    while 1=1 do begin
' e) }3 {1 u9 J* O/ v/ B8 F        read A_tote from "data.txt" with delimiter "\n"5 Y$ W% u6 }* A# \- z" k
        read A_time from "data.txt" with delimiter "\n"
2 H, O9 d9 E4 C! k2 F        read A_leave from "data.txt" with delimiter "\n"& A3 k' E0 o! J- W
        read A_picks from "data.txt" with delimiter "\n"$ u& @' [) W; M5 ^1 Y
        set load type to A_tote
- ^  y& S6 y. D        if A_tote="tote 1" then set A_induct to 13 x- K( V5 U' l% O8 f& _
        else if A_tote="tote 2" then set A_induct to 2' E1 `5 |8 ^- |
            else set A_induct to 3    " z. ]4 P/ Y3 d5 x
        set A_i to 0+ x) ^9 S. X, V6 Y1 L$ c/ ^. }
        clone 1 load to P_induction
: J" q* _9 d% Z2 w) t        wait for A_time sec- w" k' a' O" K
    end4 m& Y) E/ |% d
end
+ n0 C  u& g% F! {& H; S: g% Q
0 V, H; n3 _. G% Ybegin P_induction arriving" A5 p0 V: t3 f( E! D9 Y
    if A_induct=1 then clone 1 load to P_pick12 M- G) F8 e: j; t
    else if A_induct=2 then clone 1 load to P_pick2) z) z5 r2 V( O3 i
        else clone 1 load to P_pick3; o6 r/ x9 C3 l1 I2 U; f2 Y
end
# f$ W0 r" Z2 _# t4 C- v% k3 o4 `5 y/ U5 C! u+ p5 S# g
begin P_pick1 arriving
/ v- l$ r$ T6 }, h7 i    set A_i to 1
- u- Y9 m$ C! w; x8 x0 e: a9 L    move into Q_induct1
) p' z( W' ^# X+ R    move into pickaisle.induct1
8 g# y2 F  R1 t. |; i& _% q; P    while A_i<=30 do begin
/ b- y. e( j- C9 R. j6 i2 L& z        travel to pickaisle.con(A_i)
% ^7 v! N9 l2 b% F# f" n' Z- e% m! g6 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 a7 A7 l  ?% P" [* ]        else wait for 10 sec
- B$ s( ^, c' v        if A_i=A_leave then send to die
; M# B* D; Z7 k2 I5 T9 K1 u4 ]        else inc A_i by 1
' {/ H) [/ u! |) i    end
& V0 j5 b3 I+ p# Rend
9 |: t- A( S( D3 }4 H2 _+ S& i
$ E3 v9 u- T% `0 Zbegin P_pick2 arriving0 b: f' J* k2 e- O9 `
    set A_i to 11
# [8 D' p2 |" f5 Q$ _+ L4 D) T  G    move into Q_induct24 l6 G' i% R# ]* u2 Z' C
    move into pickaisle.induct2
8 _3 |4 P( ~0 Y  j6 U# n    while A_i<=30 do begin0 g; \  C9 ]8 r$ t$ v& x3 X+ q
        travel to pickaisle.con(A_i)
( n7 b6 L, x" F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" P4 }% ?+ J7 ~9 k% ?
        else wait for 10 sec- ~+ c1 w, x" H4 D9 S1 E/ s
        if A_i=A_leave then send to die
5 F* U8 T3 Y  f; o2 L: I+ X        else inc A_i by 1
% M% \) V/ ]- l+ ]- e# H    end
6 W1 S" R1 o/ B0 k  L+ d+ [3 Bend
, A* C$ \% d. u6 O
. ?  ~7 s' Z: }5 h/ M: z# ]begin P_pick3 arriving
9 r5 s: \7 L. Q! D- B* p    set A_i to 21. E2 x% Z3 E6 v4 G  d# O
    move into Q_induct3
5 d) g- p- B) B# \    move into pickaisle.induct3
' M1 @; k: Q* t) J    while A_i<=30 do begin
. W! g) H4 T+ u! H        travel to pickaisle.con(A_i)
$ [& b7 u# r  u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 Z& C* V- m& @9 D- J9 i        else wait for 10 sec
0 F: M, t  T- ^, V) j# j        if A_i=A_leave then send to die
8 A; O; ^, r. y8 g        else inc A_i by 1
/ V+ ?  `$ v. }2 r    end7 Z. y' a1 @: I# `5 m( @) V0 d
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是个什么东东?4 K' p% |. O* N7 e7 ?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 e  i1 c* E  a
6 u* y5 @4 Y5 O, q$ w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 K/ F- u$ d8 V) D1 M- w; o
* Z+ O/ @/ s0 \1 d& ~% P6 m- b: `. F3 J另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 C0 y9 L. j  V0 N% X1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 B$ h9 b3 t% ?
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 `% Z1 x- l% W& U( F4 E; Y* g2 {' o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- a& t" i- N5 j# {& c4 G) |begin P_induction arriving
, N# b. Y3 X2 N4 X% w$ W$ Z. v    clone 1 load to P_pick(A_induct)
$ O8 k. M* p7 E+ T3 q% Lend最大的系
5 O+ y/ ~. n; P# o9 W3 i" H1 l
3 \* b  _$ W$ I" H4 \9 J( Fbegin P_pick arriving
; A' a6 r! q% o4 P: j    set A_i to procindex * 10 + 1
+ q% b& x, l' d) |    move into Q_induct(procindex)
1 D8 i" e- m! _    move into pickaisle.induct(procindex): S; ?1 M8 c9 ^6 P8 _: x$ I& [. n* T
    /*check the type of pickaisle.induct(i), for your last problem.*/% W2 e/ E) r7 D6 `  g+ ~
" W9 v8 b. M. A+ Y) O
    while A_i<=30 do begin: ]8 |5 e0 i5 k
        travel to pickaisle.con(A_i)8 Y& p* O" d. n; Y7 B# H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 U9 G9 `. W' o& v$ v$ N
        else wait for 10 sec
9 H; b7 [5 Y9 Y! A        if A_i=A_leave then send to die
5 \9 g) I2 C$ K8 c        else inc A_i by 1
% J; n6 H7 C+ ]' Y    end2 [, d  |" x5 w- k1 T( t
end
+ w' W/ S2 D. U' s7 w( n$ f( s3 a1 K* B) k: x* q  W, V
其中的procindex为整形,代表当前process的序号。
1 ~+ O, G1 ~# [4 D7 c2 zstation和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, 2025-12-7 07:13 , Processed in 0.014257 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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