设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12947|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 N( I+ ]0 R/ I. r( g, X. L

$ e# b) ~( s3 ^我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 S+ D1 N$ i6 x& F9 n6 ^
6 `5 Q, H1 c7 J- K0 G$ _; o2 x+ |7 G
begin P_read arriving
; F4 f+ g1 S' |) ^  |- l    while 1=1 do begin/ I. {  R0 E8 J( |4 a
        read A_tote from "data.txt" with delimiter "\n"
0 N. A3 R. W7 f, S4 K. a+ K        read A_time from "data.txt" with delimiter "\n"
; @: I0 g7 `0 M        read A_leave from "data.txt" with delimiter "\n"
$ F6 _+ D0 M  ?8 ]1 j        read A_picks from "data.txt" with delimiter "\n"
8 x- k" q$ ?+ e% |0 A        set load type to A_tote
' L# ]! [" p' {        if A_tote="tote 1" then set A_induct to 1
2 y! I$ G, g4 A$ a+ B        else if A_tote="tote 2" then set A_induct to 2
6 ]* [! T; p/ U1 s" t            else set A_induct to 3   
: l& D8 d: L% Q        set A_i to 0
. w, U3 c8 ^' s" e" A& c$ I4 q        clone 1 load to P_induction9 ^! J' \- Y- a7 f' `
        wait for A_time sec9 k  O1 _+ e- p9 M! l4 d0 o
    end( M; w! T! L' W7 B
end* C, b; j9 e) t, P

. S8 \. V( Q! A* E* y2 ~& \3 W+ Nbegin P_induction arriving
4 D8 }* r5 h- L4 b    if A_induct=1 then clone 1 load to P_pick1
* S, `) U2 q1 d1 f& K    else if A_induct=2 then clone 1 load to P_pick2
5 _! I+ h1 V; h. `        else clone 1 load to P_pick3) v6 U8 I4 i+ n% X7 O+ I
end  J$ z( Z! t6 A8 x/ o, f2 ~
- k* Y6 v& k9 V6 v; @1 `
begin P_pick1 arriving
0 T' C2 ?3 r) |7 D- \) u    set A_i to 1
) i) N; O: p; o, m+ H# d: o    move into Q_induct1; x9 O) o/ I, `5 _1 A9 f
    move into pickaisle.induct1- ]- x3 w" q# ?, a% T% t1 ?
    while A_i<=30 do begin
) m& s% o! l& Z        travel to pickaisle.con(A_i)
" U! }: `5 k% f: ^6 Z- C1 A" }' ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ M: q% I% {% g- S5 z5 i
        else wait for 10 sec' c# \5 {# l! [' v7 A5 u
        if A_i=A_leave then send to die
- y" W, R/ i7 Q3 X# |0 y        else inc A_i by 1! n( B0 Y$ K. P
    end
' }9 ?9 s' w1 {7 c2 {' tend
2 r2 o6 [; w* l
3 m' X6 N8 ?$ Pbegin P_pick2 arriving
; J5 y9 d0 s3 R  |/ ?! G    set A_i to 11
& G: g; @5 Z* ?# E* n0 \  x# j    move into Q_induct2
/ x0 m5 h4 u2 \% S' l    move into pickaisle.induct2' x9 g/ O/ n& M# `3 j' S3 ^! w
    while A_i<=30 do begin( u. I" c2 J' a6 `+ S" }7 ^% U6 K
        travel to pickaisle.con(A_i)2 K- s: A4 D, q3 y8 y' R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 ^8 Y" `. b" ~4 l# u' d& r9 ]+ n" M
        else wait for 10 sec
5 Y' T* f0 d: N* z1 E8 K        if A_i=A_leave then send to die
* }- F3 W; f$ Y' o: E        else inc A_i by 1; J, D0 i, L, s3 R0 o4 E, Q, j
    end
+ x5 H  _4 C. l) Q! tend
& C' q5 e/ D: L" W5 T1 R& o% Z# q7 I) c) B
begin P_pick3 arriving3 s' F( s, s8 Z1 f: G" w' a& u
    set A_i to 213 j/ M% Y6 J1 Z: ?( ~6 {+ T
    move into Q_induct3
& M9 F* t9 p- O# m0 ^4 m2 P) t& J    move into pickaisle.induct3
/ U- U7 }9 m& [# W" n5 N    while A_i<=30 do begin
  o2 ?# d! d+ R        travel to pickaisle.con(A_i)
7 p" a5 h6 M7 V1 E+ \  K0 b# e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 G* u9 u% C$ R* S' J        else wait for 10 sec
- X4 O% B& _: f6 J/ T. i        if A_i=A_leave then send to die
. }3 i# ~2 W5 D( I# f        else inc A_i by 1
0 S3 k# R  Q: R5 u    end6 ?6 Q% y4 l" m' ?+ I( o0 Q0 ?. U
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是个什么东东?
* @8 I& I% A+ [4 fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 ^$ i2 T7 z5 J" ~$ Z! X* @
, d4 j/ o2 t4 @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; h( M9 p3 ^! Z8 `' |" l; b3 d1 n4 Y7 P
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ F  F" X. J: F* O+ {9 T( y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. Q1 k4 j3 ?8 N8 D0 _! T+ H$ U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 C7 h4 t0 l4 U4 L& E  W" T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' v9 H$ i* U0 g, h7 a$ E7 Lbegin P_induction arriving2 s) m1 a2 R5 E! K. v7 O
    clone 1 load to P_pick(A_induct)5 _, I0 n* E' I, m; H0 l$ p
end最大的系# h+ g( O7 S' d/ ~% i& J) G
" a0 t- |9 V1 f4 P) a7 h
begin P_pick arriving6 n; w$ A/ K! {  b( s$ n3 N# h
    set A_i to procindex * 10 + 1% z9 k0 P! [* H$ w
    move into Q_induct(procindex)
" t8 P% B1 F' z    move into pickaisle.induct(procindex)
2 r. I4 @: u1 b    /*check the type of pickaisle.induct(i), for your last problem.*/
3 a; f0 y# M! w( r* f( \
, b6 h2 c* ]8 q* Z+ `1 N" [: ~    while A_i<=30 do begin) ^' q/ ~6 _+ h) S2 r
        travel to pickaisle.con(A_i)
3 T% g9 p9 C. Y5 O( C( i; m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) N- @  P( h2 a* k: `2 C$ k
        else wait for 10 sec; ?2 Z7 c* b2 z$ a) Q8 o; k
        if A_i=A_leave then send to die
" y8 f" [- I$ i) \& i% b/ J+ r        else inc A_i by 1  G  U/ K  W; J
    end7 i6 n' O% H, T
end
0 b0 G. B- B7 N+ l5 O# p/ H+ j! J4 Y. [8 Z3 F" H
其中的procindex为整形,代表当前process的序号。# ~" Z. z7 e4 J# a) z6 N7 T
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-3-4 20:32 , Processed in 0.018849 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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