设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14825|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- }. ]7 V- ^* l, d+ q5 [  o
1 @% W. R/ S1 ?4 m
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 E. R9 j7 f3 H4 `9 l; |5 e

. G% @( F' `! R4 q$ jbegin P_read arriving
' e1 |4 s: z7 N) \. s( t    while 1=1 do begin: ^; N) m( \6 A
        read A_tote from "data.txt" with delimiter "\n"
6 v/ w* m. b% w5 q( r& f  E        read A_time from "data.txt" with delimiter "\n"  E# H+ }' O: l2 O
        read A_leave from "data.txt" with delimiter "\n"
0 s. a) V8 l$ }0 e7 d/ X$ e        read A_picks from "data.txt" with delimiter "\n"
3 m2 p. R2 U3 C' n5 y3 `5 }        set load type to A_tote
8 f6 R+ y% I5 @; ?7 y1 K6 M        if A_tote="tote 1" then set A_induct to 1
% b; u+ q4 n8 ^* G2 W        else if A_tote="tote 2" then set A_induct to 2; H2 j" r) ~+ [# N' |1 U
            else set A_induct to 3    ! c1 r: g7 X& T5 j8 Q, @
        set A_i to 0" g3 Q6 d% r) ?5 [
        clone 1 load to P_induction
% a$ Z/ p7 v3 o$ ^( J        wait for A_time sec$ e9 A1 E; u6 d& P  r9 _* W- i& B
    end$ C: i6 x8 _5 Y
end( i5 t( M* t) B1 i
' n) U4 X/ L$ z. }; c& f
begin P_induction arriving) L: q+ c* D4 D& a
    if A_induct=1 then clone 1 load to P_pick1
. H3 e" X5 }3 G$ P3 [" t0 u    else if A_induct=2 then clone 1 load to P_pick2
: i$ z- |; ~) q, Q; C( S        else clone 1 load to P_pick3
5 T* q5 K0 E2 K% t+ {end
# D. o. `: S: H! Q9 P9 f5 }
( h3 o0 D- S; B# F3 ~0 g8 e  m$ z) y8 dbegin P_pick1 arriving- ?& V4 |9 g& u9 R" _" A' ^
    set A_i to 1
% e7 v, j+ u/ \: |. x7 z; u    move into Q_induct1
* q; W4 D4 T) \5 n5 B+ v1 P, O    move into pickaisle.induct11 O' b/ }* j8 [. E9 I
    while A_i<=30 do begin" B3 x+ e% W* q7 w4 d6 m
        travel to pickaisle.con(A_i)  z& ], w# ?0 h  m( l9 r2 c6 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 B$ B. d. {: u5 u
        else wait for 10 sec
2 i3 l$ l/ J. Q* L$ b+ V2 o$ _8 R2 X        if A_i=A_leave then send to die
/ T! Y+ E$ [+ h) m: d* ^6 F        else inc A_i by 1
- L* o) W3 Y% V# e* \    end5 h& Q8 E* w3 a9 ^8 X1 a6 g# A
end
9 m* @2 }% ^# l
5 W5 K' v6 o, C9 R3 s( n  H' J) Nbegin P_pick2 arriving
) ]1 h" a$ `1 F" e7 o# N    set A_i to 11- o" [2 ?. o, A+ ^+ _& ^% v
    move into Q_induct2& z( H8 Y* k+ p. {" c
    move into pickaisle.induct29 q% c) D7 k! D' G
    while A_i<=30 do begin
! k2 L. [& q' d' H        travel to pickaisle.con(A_i)
, G* N7 Z- m/ O6 `# B& V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) ~8 H- R2 j' I  @; \% P& c
        else wait for 10 sec
0 g- K+ ~9 [) q& b; y% S3 f1 i        if A_i=A_leave then send to die
$ k: y7 i  g3 j0 i        else inc A_i by 1
' U7 i% n; ^1 e# k1 \# u# w. w    end2 }* W5 M, m. e- A
end- i% M/ j% r( n6 [& i3 J- ^
! q! O! C% M  j* U
begin P_pick3 arriving& N& z: p4 d$ O  Y
    set A_i to 21
4 V% S% {# `: m$ Q6 R5 s! C* j& G+ D    move into Q_induct3) D) {6 C, E9 U0 B- [
    move into pickaisle.induct3/ M; `. J7 x8 V) r- \
    while A_i<=30 do begin
0 W$ F7 L) O" ?% `: _        travel to pickaisle.con(A_i)
  ?$ ~' }. y% b/ F2 U6 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( j* J% c1 {" [- b, W! ]
        else wait for 10 sec( a; A. C$ }8 ?, Z% b
        if A_i=A_leave then send to die- r' |2 I2 s& _# n; J6 w& O8 p1 P
        else inc A_i by 1
& R8 f, a& T# R, h4 k    end
; u9 W+ J" o$ 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是个什么东东?3 Z+ Q8 K4 Q$ j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( X. z8 |6 F0 g8 }

7 Z5 O' x+ c+ j) H% W9 \: IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' n5 e6 J2 S6 I; \

2 n4 i) S& v$ Z  d: y4 |5 v- Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# Q' v# x" v5 D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' G5 n; Z  {- `* x* q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  b% y7 L) F. T% W+ c- Z1 `9 \3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ ]7 E3 |: i4 Q% T( L" @2 C0 {# qbegin P_induction arriving
( i! ~. }4 A7 ?) ]    clone 1 load to P_pick(A_induct)
7 a: l- }7 `7 ]2 t* f& ]9 W( B, vend最大的系  @. D- H) _! J8 L' x: ^/ R

( F# e! J- r' z# hbegin P_pick arriving
6 p. s  t& u0 ?" T1 r. j2 x    set A_i to procindex * 10 + 1
+ q; V" i  u6 _0 {" @9 z% ^2 b    move into Q_induct(procindex)' [1 z  ^" h5 E5 p* O: d
    move into pickaisle.induct(procindex)
: m* p3 r# Z1 M5 W    /*check the type of pickaisle.induct(i), for your last problem.*/
% w3 g" a( j3 ^6 {/ Z# S- h+ Z* V0 c/ b
    while A_i<=30 do begin
, V' u8 |1 D' k6 j        travel to pickaisle.con(A_i)% z0 V5 W. R* u. `+ A& g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. q( L7 o' B& O* T9 x" G        else wait for 10 sec) `+ E" p$ M5 [
        if A_i=A_leave then send to die; D) R" X5 H. _) N: V/ ^
        else inc A_i by 1. {* q9 \: ~# K3 ?. k
    end
0 Y! z/ L8 q# dend! Z. |5 h6 U- V% ~6 z: ~! j
! E; k4 A( B$ W! t) t
其中的procindex为整形,代表当前process的序号。
& v/ q3 ?+ n& D9 }# Kstation和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-28 07:36 , Processed in 0.014726 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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