设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14287|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ T0 ?6 V  P9 N% h5 w
7 B% {; E, `/ W- 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中的数值,不知道会不会有什么不妥。
7 X! l5 [) s- I( s1 k6 H1 E& `
: T/ [6 }1 i7 Q. J0 i6 R6 i% K+ E- o0 ibegin P_read arriving
  F+ F2 s# I7 x. ]    while 1=1 do begin0 c& {0 J4 Z& B1 ?/ z% R
        read A_tote from "data.txt" with delimiter "\n"( \0 @6 `9 n3 w# X
        read A_time from "data.txt" with delimiter "\n"
$ ]! C6 I1 S3 `2 @2 h% v2 ^        read A_leave from "data.txt" with delimiter "\n"  I4 W6 ~0 p* R. C; T6 A% P6 _
        read A_picks from "data.txt" with delimiter "\n"" i0 p4 Z, L' k
        set load type to A_tote
) v+ a! C% h8 s% J        if A_tote="tote 1" then set A_induct to 1
% D4 v6 l" T6 O- D5 x        else if A_tote="tote 2" then set A_induct to 27 b  v& d  p4 ?" J
            else set A_induct to 3   
7 ~1 Z, r7 i7 v        set A_i to 0
% {  Q; R6 d$ \7 m+ K; ?9 o        clone 1 load to P_induction
$ ~8 G0 G1 i2 q) }' O; b        wait for A_time sec
+ B4 @# F3 g$ ~& F9 w    end
6 E, ~* a' N# h6 ^4 A. Z( ^end# p! l+ Y# v1 z$ E8 X1 v, }. m
, v0 I' O* R$ ]4 L2 r
begin P_induction arriving: n7 l! [6 i! P" _
    if A_induct=1 then clone 1 load to P_pick12 f7 a% b, m' |' p( r! D
    else if A_induct=2 then clone 1 load to P_pick2
$ T4 q! [% x4 m- J* f: F0 u2 X        else clone 1 load to P_pick3" [  h; }) ^, ~" A, b# ]
end" R+ J: @( w- k) Y) E. Y
. ^0 R# ^& s# `5 m2 L7 b
begin P_pick1 arriving5 G) ?3 L6 l3 {) K+ ^, F9 g2 Y
    set A_i to 1+ @+ n4 }9 }- J! f# J
    move into Q_induct1! C! \$ t7 N7 v& G, Z
    move into pickaisle.induct1
+ ~9 i! K1 P  N9 ]    while A_i<=30 do begin
" U" y& |/ Z; e/ a( N# C* |        travel to pickaisle.con(A_i)% m/ F+ E- G$ `: V( |% \8 E; Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 Y" R3 G' q! k  l; ~        else wait for 10 sec
) X6 r. C: w3 E        if A_i=A_leave then send to die1 c& x2 ~* v+ Q. `/ C# K5 v
        else inc A_i by 1
8 p  m8 O1 a6 Z+ e/ e  M    end, u# `) e9 n5 b2 q3 g
end& ^  T- \3 b: U3 i. e" ^% y
$ G3 |- y* J9 @5 J, ]1 G5 h0 d5 \! }& V! v
begin P_pick2 arriving
$ X$ h9 M5 S1 k) G    set A_i to 11
/ X1 ~. v  K/ F! B    move into Q_induct2
+ F: M6 e+ r. G3 n4 b    move into pickaisle.induct2
) R- ~- q) h. Y; ^" l) K$ e    while A_i<=30 do begin5 p3 w" y- U, b2 p$ U
        travel to pickaisle.con(A_i)
( f2 F1 w1 C8 `( Y$ x) ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 B+ U7 I: m/ O" [        else wait for 10 sec
7 }5 L- O9 Y: H% E0 G        if A_i=A_leave then send to die
0 k2 ?4 ^5 a; u- I# t" l        else inc A_i by 1+ k& r! H8 e' i0 O) i
    end
1 f+ E8 z/ A. S# d! ~  n# Y$ mend
; u! y9 t& w* E% O5 l. w) w4 O3 @7 ~
6 ]0 z8 |! q1 c8 n) R- pbegin P_pick3 arriving
$ C" }  R9 q" n: i. e4 B+ `    set A_i to 214 y- K8 f& f- U
    move into Q_induct3
8 o- R- t& F( k    move into pickaisle.induct3
% V* M0 @' k) U6 ]7 L8 l# d    while A_i<=30 do begin- `5 n, @( }9 ]- E8 h3 L" g
        travel to pickaisle.con(A_i)
" z$ F' }: P: K$ }  H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# T* f# j) u' h        else wait for 10 sec6 x6 @% i- Z7 d) K2 g6 j. f
        if A_i=A_leave then send to die& M4 \8 V% K* w; S' @( E7 y
        else inc A_i by 1# m# l6 A4 b) H& B' N/ F' u& a
    end+ n0 C' I+ w, ]7 a; `1 h1 H
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是个什么东东?6 q* b& A, ]0 }6 X- I6 B  o* h' r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 G9 t6 v" |& e7 m- P

& y4 P- u6 r& n* ZAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ N5 \+ i4 x; p/ S. U7 e! H5 Z( e8 J, P1 _8 ^
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! r. B4 \5 |% B4 T. N6 b1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 @7 F6 a' l! r# ^% o( a3 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( w2 G1 n. |4 w2 E
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, `/ f3 S6 ^( N, abegin P_induction arriving7 }  d7 E, B6 _3 N
    clone 1 load to P_pick(A_induct)  y+ z+ w, `0 g$ C
end最大的系" b$ u" b  ?9 y) F- T! q
, S. C8 {: F: B& u" a
begin P_pick arriving6 ^: p3 \) h& j( j$ ~# J4 A
    set A_i to procindex * 10 + 1$ j  D3 N0 O2 I9 a% b8 Z
    move into Q_induct(procindex)
: ?2 S6 n9 b2 a2 g" Z    move into pickaisle.induct(procindex)
7 O% ~- f- V) N& I  C6 C    /*check the type of pickaisle.induct(i), for your last problem.*/
: n7 M! P$ ?4 i7 x' W4 r' a0 f) B9 {; v. g  _, K, j
    while A_i<=30 do begin8 H# r! P% S# T- ?+ A' t
        travel to pickaisle.con(A_i)
: Y' I$ H+ k: o2 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ l( ]# j5 U+ P5 z% \6 B        else wait for 10 sec6 {' \# @+ d( S4 e, s& ^7 p
        if A_i=A_leave then send to die" Z* d# V/ u- U  M( [; U  ]/ o
        else inc A_i by 12 _% g1 T9 w* V, X! u, k7 }
    end
( e5 g! G3 r5 b( o) Q4 Aend8 {5 F/ `7 |# s) g/ P% [( ?
7 l0 t* \) S* P2 S
其中的procindex为整形,代表当前process的序号。9 N7 y/ \2 A" R# N9 O
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-6-28 07:53 , Processed in 0.014485 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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