设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15093|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& q7 ]0 U- q; X; [0 p- T! |

' w. N' Z6 P/ r/ 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中的数值,不知道会不会有什么不妥。
4 P  M) c3 X' _9 `9 l6 U) n" n. y" C  Z, Q
begin P_read arriving
+ _& r/ @# g' G& r; v; T" U    while 1=1 do begin7 \; b5 R: w2 L- _) }$ v$ u
        read A_tote from "data.txt" with delimiter "\n"
' B3 R; q; C4 ^1 p: H        read A_time from "data.txt" with delimiter "\n"
- |; U( e. ^: C- X4 q        read A_leave from "data.txt" with delimiter "\n"0 }& E3 P6 J' j: C
        read A_picks from "data.txt" with delimiter "\n"! M# w1 ~: C" J7 j5 Z
        set load type to A_tote* V+ o0 N, S0 q9 M9 H
        if A_tote="tote 1" then set A_induct to 1
* L8 _; @2 C6 e5 f# p! E        else if A_tote="tote 2" then set A_induct to 2: D5 M6 f+ D: P6 L
            else set A_induct to 3    . M6 q6 `7 w; z9 A% ]
        set A_i to 0
8 T2 o9 D' P% b6 J9 y* R- r        clone 1 load to P_induction
; k2 e6 x3 h* S4 {/ v4 B6 {$ A        wait for A_time sec. E+ S2 F7 I4 s2 M  F) e
    end2 O- _7 n4 J; W9 V
end
6 u4 ], C; ^; g' n1 m" r
9 M1 G5 X2 W9 |; y- wbegin P_induction arriving2 A9 a; Q. X. ^; @  \
    if A_induct=1 then clone 1 load to P_pick1
# |, \3 b; H# U. ^9 t# I, ?    else if A_induct=2 then clone 1 load to P_pick24 J  T  K5 N  P
        else clone 1 load to P_pick3
$ F, Z3 {: M( @9 Kend$ x  {6 f: p! c1 V. D& A
2 H3 V' A  {7 ~7 e' z
begin P_pick1 arriving* a/ d4 b2 Z, p
    set A_i to 1
- T+ Y* q. x' I( M1 J3 k7 H3 X* D    move into Q_induct1
* _) M. B# e3 T9 g0 k7 M    move into pickaisle.induct1
  y3 [4 Y* S" k5 e, T2 G% r    while A_i<=30 do begin
' e; ^$ ]5 S9 P! U, e' f2 d* J        travel to pickaisle.con(A_i)0 @$ M% Y; k0 `. J' s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* m5 C% N9 f! ~. j
        else wait for 10 sec
& c! w  J! x  z        if A_i=A_leave then send to die
% G' p6 ^6 O" w( G, u+ {3 Q        else inc A_i by 1
1 y( T7 G3 U" S& P5 E$ Y# p    end6 P  N# r2 B9 ~# Z6 {- D( @# z
end
+ D8 u( ]: o- U$ ]7 g( A* J( i3 i# Z2 v' V' c
begin P_pick2 arriving
0 Q9 J5 c' ?8 k+ Q6 V: a" y' C    set A_i to 11
6 E1 _& Q9 P' J' P    move into Q_induct2
) S3 i5 ]! z" P    move into pickaisle.induct2
1 j- N& @0 q6 s( y& o/ J    while A_i<=30 do begin
; N. J$ d3 Q; `9 H        travel to pickaisle.con(A_i), N. o* G) V( I2 `# w5 t- m9 o3 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  L# t* h8 o% Y0 Y; W; O% d2 H        else wait for 10 sec$ t' `. \( g/ M8 s2 v
        if A_i=A_leave then send to die
7 X1 h: D6 R0 V3 l/ x: I0 H5 Z, m        else inc A_i by 1* f8 R; c% a8 d- d" [8 f4 y
    end
. P  H, d1 l, x; L) ]; E" r3 Oend0 ~4 \9 v) r+ r. n
7 C0 {: g+ h( @" g7 C- C" n9 \
begin P_pick3 arriving& e8 X# o- d3 C# b' |. s
    set A_i to 212 @8 u' E- I7 I4 C
    move into Q_induct3
0 v* {. q8 z8 u0 c- C4 y    move into pickaisle.induct3& o. K" q4 f) W4 w7 f
    while A_i<=30 do begin
8 J* x1 @, k+ I! I3 u" H        travel to pickaisle.con(A_i)1 ^6 ]/ n% o2 X7 s  B0 d& H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( |. x! B# k% W( t1 ?4 m        else wait for 10 sec
' _* t, a+ g; t; x& ]        if A_i=A_leave then send to die
% Z1 h7 m% \6 t% o& ~        else inc A_i by 11 y& R. ^5 E* }' h
    end
) Y+ t1 `5 Y& Q' 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是个什么东东?  x  }! H5 t  C5 F( E- ]4 ?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% H% \9 Y. B' a+ Y

* N$ C% P7 ~3 O  iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
5 X) e* [$ R! x! B/ x: n: U! r
  P* u$ S: I9 B1 W1 L. u, z+ Y/ z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, P$ q  B. }* m% T, W& y) J" v) t3 c
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' I' G- m5 q7 \% p! ~' W2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ }8 p2 X  p$ ^- F8 V; N3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 ^2 o" W& K1 d6 p+ B0 Q
begin P_induction arriving
" G8 o7 p- b; {! _) p7 E$ w. ^1 R    clone 1 load to P_pick(A_induct)
( v* e' v+ D) t. d8 A" d0 b/ |$ Aend最大的系, M7 p1 R2 v8 C  v

* ~6 c+ ?( g3 b5 ?; _begin P_pick arriving; t3 ~! b* h" I/ ^/ `
    set A_i to procindex * 10 + 1
) f+ s  J: b8 ^: K& m1 n    move into Q_induct(procindex)
. x0 g  \3 K7 g% \- q& X& a# D    move into pickaisle.induct(procindex)
( y6 i7 [7 Z6 P& y! C# b    /*check the type of pickaisle.induct(i), for your last problem.*/
; O  u: N$ ^, N$ t4 p( A: o' v7 s5 L" ]  m+ [& X. n. K2 e
    while A_i<=30 do begin
; b* i+ o0 n7 S) g3 X# i+ h+ U        travel to pickaisle.con(A_i)) L" j$ l8 z5 ]" v) U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# _/ E7 ^6 \+ a! {8 Q- ?7 m
        else wait for 10 sec
2 X3 u* }9 g4 o) ]8 ~        if A_i=A_leave then send to die/ z4 O9 v. z$ g1 C6 w$ T& W
        else inc A_i by 1
7 O0 F7 w) _8 f4 A1 p' ^# B: z0 p/ l    end9 G7 w, @* G# X5 d' x- R( B
end( ?' X4 R; O2 [- c

; A# O8 m6 j, \2 U! g4 i其中的procindex为整形,代表当前process的序号。
7 ^9 I! n1 C% Y& Hstation和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-8-9 19:07 , Processed in 0.018019 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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