设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15229|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' @. f. ~" y" V9 ~) V- w' S' K  d7 R: k, t) a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( M: _, e$ X3 R5 S. @% x  E  P2 x- L5 w, {. _
begin P_read arriving3 Q4 f; F8 E9 S) G% m
    while 1=1 do begin
! K* t# A/ E# J0 s# r% E" c        read A_tote from "data.txt" with delimiter "\n"" k% W: F9 r+ E5 s
        read A_time from "data.txt" with delimiter "\n"
) [0 e9 R  E. Y4 y7 B/ L        read A_leave from "data.txt" with delimiter "\n"
/ _0 q6 Z+ r, N1 C2 D        read A_picks from "data.txt" with delimiter "\n"
- W! m2 I% Q% }- I$ n2 @( O        set load type to A_tote
; o7 G8 P! `6 g. i        if A_tote="tote 1" then set A_induct to 1
; F2 T" Y: L& o7 V8 `: z: G' W        else if A_tote="tote 2" then set A_induct to 2& _$ D" W' z! q! C# A9 T
            else set A_induct to 3   
. E' L+ i- B1 U( }3 ?7 x        set A_i to 0
3 Z- O1 M2 e" I+ C+ C$ u7 X        clone 1 load to P_induction) A! n8 K  I3 {% o7 R' |: z
        wait for A_time sec
8 _" I  O# l& O0 C/ T    end5 y# `* p3 A$ N+ N2 ~
end
) ^, ?* }7 `7 [6 d& Z' Q* G0 t' I' R8 r  {2 n% D
begin P_induction arriving
) Z7 r) o5 Q, M& i/ f    if A_induct=1 then clone 1 load to P_pick1, t# Q& b7 y0 z0 U
    else if A_induct=2 then clone 1 load to P_pick2
3 c6 R. f2 a, ]  v1 C9 D        else clone 1 load to P_pick3+ b- H+ a1 U6 D5 W2 l/ q
end( \4 ?- U; I! z- T
4 n! J2 l( Y) Q( j* P
begin P_pick1 arriving
5 w" Z( D3 O0 F. `5 i0 U    set A_i to 13 |! g8 Z! |. j5 Y
    move into Q_induct15 L* s& V8 P: {4 d" O# J# E# h
    move into pickaisle.induct1/ y* b; D$ |8 n6 y) m( B- h: q' [
    while A_i<=30 do begin* c3 a- Z: z( n# K. j: U/ \
        travel to pickaisle.con(A_i)
9 K) e4 @7 {) {1 Q8 L# h) S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- g4 w$ s4 L) l1 t) J' {: q/ h* p        else wait for 10 sec$ R$ s; ~+ L7 M! f* n# h' C7 O
        if A_i=A_leave then send to die
1 m8 o9 e; U$ M0 D        else inc A_i by 1/ `8 R& u$ F4 |
    end) t  ]" N: K  [; L" b) {2 ~# E
end
3 c# a1 C0 I; @$ m" d/ C. P, s4 I9 s0 {. |5 k2 b' q
begin P_pick2 arriving
: X, p$ [( ~4 c; C' A& A    set A_i to 11
2 E5 Q0 {6 C/ r# l    move into Q_induct2
1 v) X4 G$ E# ~    move into pickaisle.induct2
+ W9 T% e! B! w    while A_i<=30 do begin
8 P* ?* o, [* ~4 I; K3 ^5 D1 k9 F" X        travel to pickaisle.con(A_i)
1 s+ ]. m5 H. v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 G( j% b+ V5 c8 L# S
        else wait for 10 sec0 b1 `! B0 d, N* T% m+ P
        if A_i=A_leave then send to die0 g  w! s/ Y- W7 m( ]
        else inc A_i by 17 F4 N. D) O. t8 K1 i* B- Z
    end
9 p% y! b" y8 t1 J8 Z2 F4 Zend* s/ z. z$ G, ^* o3 j" G' l  J

" M/ G6 v( h2 Q4 Pbegin P_pick3 arriving
  E8 n2 p) _5 R7 _/ E$ ?    set A_i to 213 ^+ Q# R1 w9 h2 {5 ^. T
    move into Q_induct31 M- c; j' _9 E& ^+ l6 W1 c3 ^
    move into pickaisle.induct3+ d9 y+ p) O, N' Y7 s9 z
    while A_i<=30 do begin
5 v& J( \% I5 D/ A- S. d        travel to pickaisle.con(A_i)
7 F$ W3 ~% C; [8 ?# ]& o- u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 T7 A$ N3 E% Y9 @' T) A$ N
        else wait for 10 sec
# j" o1 s9 h8 A6 }' C- Y% G5 Z        if A_i=A_leave then send to die! X( a0 y- u  g0 }# m" D
        else inc A_i by 19 c1 R* Y, i3 k5 R
    end
; n/ a% P) M/ _, V$ lend

最佳答案

查看完整内容

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是个什么东东?5 y9 a3 s8 z- i4 X1 a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- S' A0 F% m! [) N
" B1 C$ t9 @. Z9 M: N- e5 ZAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* G$ s) F8 [9 C
3 p/ p4 Z; x% p' W& `* H- T$ k- M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 z1 ]1 d7 ?1 |7 G( U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 @& @! b2 U5 \+ I3 ~0 ~
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 P3 F% G, ^) R; d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& o4 {$ a2 t+ \
begin P_induction arriving+ i8 Q, ]0 h1 w3 {- |! S8 M
    clone 1 load to P_pick(A_induct)
$ S- W4 s' J, X4 @end最大的系0 O) t3 ]7 \# N4 Y2 h/ p# v

( j1 [2 D+ {! s: ?8 z4 S/ t/ sbegin P_pick arriving
+ J$ f" g& c# ~  a5 |: D! |    set A_i to procindex * 10 + 1
6 Q  n9 |) c7 O2 r% j4 R    move into Q_induct(procindex)& z" l# D/ W8 J- s, u' Y3 ?
    move into pickaisle.induct(procindex)
$ X+ }5 N1 Y4 P' ?3 I% v    /*check the type of pickaisle.induct(i), for your last problem.*/. o. K7 x7 V( A
6 |" a9 g+ a  f8 E- a% ~4 m
    while A_i<=30 do begin8 f! X0 P6 L# Y2 N) L$ C( }" {
        travel to pickaisle.con(A_i)
4 Y8 ?4 B* V* e0 X# I: y+ ~7 x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 z& F! u1 K  Q' x3 o9 @        else wait for 10 sec
% s# f; l7 ]/ \1 q+ ~: t! r8 |* h        if A_i=A_leave then send to die
+ R6 ~' |! ^4 G( X8 `        else inc A_i by 1' s, i3 P: J0 A2 H! u5 h) |
    end. @3 H$ y  {; j+ U+ N2 M5 U; r, p
end1 x9 f. S& \. c5 F: p

% x# s' q+ @# M- M其中的procindex为整形,代表当前process的序号。
, T0 F9 W' U0 H* |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-8-25 16:19 , Processed in 0.016572 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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