设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14369|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 j2 Q9 P5 p/ @7 t$ _  j+ p9 n( a
- l0 h! _' o" d* P8 R, G+ f
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; k. i. \9 J; V8 M% {9 n% H

; {! u8 i% Z9 z2 X2 u( I( Cbegin P_read arriving
8 ^, g' p! |& {! A    while 1=1 do begin' r0 t8 f' W8 ~" E
        read A_tote from "data.txt" with delimiter "\n"$ p9 M( s0 l; [' S: L
        read A_time from "data.txt" with delimiter "\n"
" d1 u5 v* h0 u' k  T8 R4 D        read A_leave from "data.txt" with delimiter "\n"  E0 P2 z& L& ?. m# N+ P
        read A_picks from "data.txt" with delimiter "\n"8 ?- ~# }+ j1 p/ ^4 ^# S
        set load type to A_tote8 x2 e, D; ^% T) W' {
        if A_tote="tote 1" then set A_induct to 15 A9 i8 W9 Y) w# n' V
        else if A_tote="tote 2" then set A_induct to 29 Y8 O3 h4 N1 o$ A% M1 Q5 u
            else set A_induct to 3   
; q1 A4 ]# f0 r5 r7 h" w        set A_i to 0
8 m: b2 N+ d$ y* `2 |% V        clone 1 load to P_induction, i( C, S$ v+ g1 V2 W7 ?
        wait for A_time sec
' D4 o. L. z3 n; {9 O8 c2 ?$ ^0 ]    end
1 ^# i7 N, K: |1 Xend
6 `2 X2 U$ H6 l7 D( Q8 k% G2 V4 @+ S2 g" @4 R
begin P_induction arriving% v% j1 M+ l. ~9 `; }
    if A_induct=1 then clone 1 load to P_pick11 d2 v. `% s: z# b, [
    else if A_induct=2 then clone 1 load to P_pick2/ F; n+ b9 T/ P% U3 t- i8 |, u# }
        else clone 1 load to P_pick3
* S8 B" p# y. {8 l+ v9 cend& r% b% h8 `! n; g! x7 |

7 |' b' j% _( N4 v' Mbegin P_pick1 arriving$ K# Z- a0 ~" f  ?4 [
    set A_i to 1
. ]2 B( z2 I/ p6 C( T$ j7 E    move into Q_induct1
+ S: F& p$ F& g3 R% b. n    move into pickaisle.induct1# i* w( r4 l' ^1 X4 X% x) A% D) e
    while A_i<=30 do begin7 U2 T7 f, M' O8 y& r
        travel to pickaisle.con(A_i)2 S* R% C8 x- W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 P" X) U% V* c  h( ?. z        else wait for 10 sec
+ k. l8 G, e& Z( C. w& T        if A_i=A_leave then send to die
- h! e# c# \+ x/ u" M        else inc A_i by 1; @& ]5 u7 q2 T0 O
    end
3 f9 f: c5 ^+ \7 dend
$ f4 q! X- J4 u/ Y$ w! J) m9 g" S3 C1 |( ^
begin P_pick2 arriving# {3 z% ?( @2 B4 P
    set A_i to 11
7 _# @9 t) R- g5 b$ \; X    move into Q_induct2$ k. V% C4 c  n/ n0 L
    move into pickaisle.induct2% }, J3 u" A! s1 U9 \5 a
    while A_i<=30 do begin
% |; h! u. K$ H# @3 x" S        travel to pickaisle.con(A_i)2 O3 _( N7 R0 j* s" m7 D2 m3 O& P# I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 n7 J2 l: v) \* R$ X: b        else wait for 10 sec
: h" _0 ~# D' C) L9 K( m        if A_i=A_leave then send to die
, ^. W* x0 U1 b! Z) J' W4 K; R        else inc A_i by 1
2 n4 g0 z8 Q7 z4 z    end
2 m8 Q) ]; S6 W: V# jend6 _0 b$ e* `# k% a, U2 a3 p

' h) o( l; b2 m6 Y: t- n) a! z. M/ E$ ]begin P_pick3 arriving3 s! P9 c. m- L  a6 u
    set A_i to 21
7 G* h7 c; p3 Y% W6 {    move into Q_induct3
  W% y/ n5 }+ R! O+ c; ~0 T4 Z/ F* l    move into pickaisle.induct3
+ b3 k5 v8 @! O* {    while A_i<=30 do begin- V; r$ t1 b7 X& I2 h
        travel to pickaisle.con(A_i)
# x+ E2 c# y6 ~; O/ p( A3 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, F; X! b' h1 f. ?
        else wait for 10 sec1 F4 p0 j1 {/ U% e6 `1 [8 q
        if A_i=A_leave then send to die" r3 ]9 \' q  N2 G! V/ B
        else inc A_i by 1( ]6 O8 M4 O; V: o. w
    end
5 Y) Y  d* J9 y) Q) wend

最佳答案

查看完整内容

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是个什么东东?6 [5 e% H! x2 ~( m9 o5 l- ]
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 g/ g3 ^/ A! ^& j3 ~

* j" I' i* d+ F# H  P8 zAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% D. @% i- d% o8 z- M
3 H+ v+ |5 u* N2 ]  |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 B2 l5 {( ]3 y2 t+ G
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ `# t9 F& l, n- n$ r9 C& [5 J! @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( J8 x, G, P; ~. w6 ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 R) u& ~$ c9 z* v$ S) @# e) lbegin P_induction arriving, K" ?. w3 p. ^3 T/ }; b5 \
    clone 1 load to P_pick(A_induct)
/ |" E, A! H: A. ~' ~6 `* N2 E6 cend最大的系
* E4 p" `" N' d$ }3 g. p
2 j# h1 e) z9 w  n; ^5 nbegin P_pick arriving
: W! a; K3 c& m0 {* l4 t    set A_i to procindex * 10 + 1" z. w. v5 q8 ?+ A: P; k
    move into Q_induct(procindex)
' V: n! {, M( V" E    move into pickaisle.induct(procindex)" E* z. M$ ?) j% I7 a
    /*check the type of pickaisle.induct(i), for your last problem.*/
+ R) ~% O  S& {6 Y* R; n- i) d* N; K& s, L0 y& g/ f
    while A_i<=30 do begin8 Q% t; O3 q5 S9 n7 C. Q
        travel to pickaisle.con(A_i)
2 Y9 W  e7 l7 r& b, I& Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  b+ G$ v  `. [- O; [4 m% G        else wait for 10 sec
; f; m' ~' S" c' ?' F' l7 j        if A_i=A_leave then send to die) M: L: c" ?0 _  F
        else inc A_i by 1
% l0 J9 C, h. l7 W& H8 l7 V1 }, u/ h    end" I" b; x! y/ P: C3 K2 O
end
$ {1 [7 a' {, V
0 D4 H$ N0 d3 d7 ?9 J3 g( v; g2 V其中的procindex为整形,代表当前process的序号。; F8 e% ~. X. G2 c% J
station和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-7-7 08:57 , Processed in 0.015822 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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