设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14242|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  X7 @; \% m: ?& L' `4 D! v9 D8 y
% g( A3 e* a2 s' O1 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# k0 p2 D, R/ c- W, T4 u/ ?3 a+ {3 O( \& b/ r
begin P_read arriving
% Z1 p" ]5 N2 k1 S% x! c( R    while 1=1 do begin; M9 ^& q* X0 F3 c- n7 T: Q0 z
        read A_tote from "data.txt" with delimiter "\n"
6 S& }( D- P& _; f( u        read A_time from "data.txt" with delimiter "\n"
, c4 g% n4 Q' k7 s        read A_leave from "data.txt" with delimiter "\n"/ X% U) x' ?; ]* |" m
        read A_picks from "data.txt" with delimiter "\n"
" ^( R8 g, [5 [0 y9 t        set load type to A_tote3 @2 ~; K, e3 A" n0 m) D
        if A_tote="tote 1" then set A_induct to 1
$ w! N; Z: t5 \% i5 ^+ D        else if A_tote="tote 2" then set A_induct to 2) S6 [2 X! G( m
            else set A_induct to 3   
# k6 {3 `& X3 E1 {        set A_i to 0, Y5 {% S: c1 m6 t. @8 W( c$ t
        clone 1 load to P_induction# l" z8 ~6 l  s! R; Y& r7 q
        wait for A_time sec
0 p3 q) J2 m! v7 R; b) t    end
" z1 Y6 [5 h0 F& `$ r1 }2 O  s) oend
) V+ a9 }: L" b. `8 ?* v# T, s1 m9 k6 O9 [7 r# a1 |
begin P_induction arriving
; F$ F1 u' F  L& F  V    if A_induct=1 then clone 1 load to P_pick1
6 x) U' h  c7 \/ g    else if A_induct=2 then clone 1 load to P_pick2  k# w- e8 j' k. i3 `
        else clone 1 load to P_pick3- V' L# ]( T# C5 M, {  v* U% p% ^
end- `: w: a0 G7 T- C
/ R/ s( K3 `$ u* j4 J, Q
begin P_pick1 arriving
) C' a% D! M3 L8 ?- e& _* m3 R    set A_i to 1
' v# l2 e% s; O    move into Q_induct1
: J  G7 y0 S: [8 _# Z4 y    move into pickaisle.induct1
* s. ~1 S" T" c9 t/ I    while A_i<=30 do begin1 _7 V# g# M2 ]$ _9 d
        travel to pickaisle.con(A_i)2 {" ?8 q. @& e7 u7 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# m. ^5 ^* s. }6 }2 f) G* J; X
        else wait for 10 sec
/ T1 X/ b# N& W9 f' J        if A_i=A_leave then send to die6 ?2 Y7 E/ V" ~# [$ r- A
        else inc A_i by 1/ K4 g& Q% n+ I- E
    end
7 Z$ K- F' K  W4 j: o0 ^end; S% I/ h/ m2 n. {/ v7 a9 ?

! `% |, p; ?$ c  ~begin P_pick2 arriving7 D8 |" ]3 M' w
    set A_i to 11
% }- W/ A8 j+ c1 C& |    move into Q_induct25 j9 C7 m, w7 n
    move into pickaisle.induct25 Q+ y, g8 G, I+ t! M# v- F
    while A_i<=30 do begin; @5 {" V" j) t) p
        travel to pickaisle.con(A_i)
4 g- x5 }2 \# B. P, d1 J: t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ }+ R5 {8 a( C- [) T# Q5 V
        else wait for 10 sec3 e* W3 Z; ~& _8 H
        if A_i=A_leave then send to die) t8 S8 @; \; ?9 [! h
        else inc A_i by 1
, W  I' q, Y- G. _; O5 G4 C    end
- _  {: R# B6 cend" p. x& |1 L7 q) Q4 _/ \
" s$ I* V5 h7 Z( `4 m6 l  \
begin P_pick3 arriving. d0 h$ d& T5 c/ x9 e) N
    set A_i to 210 d5 p6 p" n' D. C; Z8 h  e2 P/ J
    move into Q_induct3" K) a: l3 W& x5 N: M8 {6 r
    move into pickaisle.induct3- k# s+ P0 p* w7 F
    while A_i<=30 do begin
, i! i% K* s6 Y% m8 c# V6 ~/ g        travel to pickaisle.con(A_i)
# [& J+ `, x7 z2 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, d$ `7 W4 w' P
        else wait for 10 sec  u/ f+ f- f7 D% J/ N+ G
        if A_i=A_leave then send to die
  e; g. g& A2 R9 p3 i0 G* l# B+ N, b. b        else inc A_i by 1
+ Z+ y0 S" S; x- e    end
" }0 z, s! ]! s% \  j, M5 `# \* D( jend

最佳答案

查看完整内容

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是个什么东东?7 N9 S% Q8 P% C1 m
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% x8 {. \; T$ k7 U

2 |4 T5 K4 @1 LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  d" u! w$ i) @& I8 w: e" B# h9 c9 S) Z5 z7 J) I
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; M9 f' |) U* t1 g1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! ]0 X! e2 ?( s  K! z7 e& y, X  Q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 Y- c: @) _- l2 ?; X$ V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, e) |; k# A/ [begin P_induction arriving
" Z3 b7 E/ X5 n+ Q, V5 {    clone 1 load to P_pick(A_induct)9 s  q, {% h' {  I* c% [& J8 F
end最大的系3 g  M+ P$ j# D, t" b! J# H( c6 h. C
8 o% m8 Z- {* P* q  M
begin P_pick arriving6 f2 y+ h" T1 m6 ?" j2 @
    set A_i to procindex * 10 + 19 L# W( N2 |4 D
    move into Q_induct(procindex)- o5 b7 f3 _5 \  C2 r, E. D
    move into pickaisle.induct(procindex)
, {- w7 c! G& p% `8 z    /*check the type of pickaisle.induct(i), for your last problem.*/3 B1 i( ~* i2 S# p& \' x

! G4 Z1 K/ {) q    while A_i<=30 do begin) _1 Y- U+ z) ^7 U/ f. u
        travel to pickaisle.con(A_i)
% v/ q6 R& w7 L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- I  O5 r; s) _7 y3 ]3 m' z0 r        else wait for 10 sec7 |. _9 k* g  v8 H. ~: H
        if A_i=A_leave then send to die
5 R, B/ H& s6 G' N1 ?0 ^0 p  s        else inc A_i by 11 v2 Z& h- b" G) h3 \7 w
    end( w6 \; O3 k0 j/ d. z5 E/ D- r
end/ D, [1 _5 z. F( o% a. R$ N

2 R! d# u& V* H0 i3 w# N+ ^2 V其中的procindex为整形,代表当前process的序号。
* x+ R! ]3 I' E- h' tstation和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-23 23:46 , Processed in 0.018005 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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