设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12965|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; B" K; I. V. `9 O, B2 E% ~- r2 n+ K2 _  |1 u5 _
我的问题是,在每个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 a: E2 P- x, W- l7 u- l2 V6 u) j

- P7 `! H8 `* j9 h; b% v! cbegin P_read arriving
) T7 C4 |" x" l# w  d1 Q+ G    while 1=1 do begin
+ e0 h0 E3 h3 [5 S5 z- i        read A_tote from "data.txt" with delimiter "\n"
* P' E$ l" \. b$ G: D7 R3 \        read A_time from "data.txt" with delimiter "\n"9 v3 }. D3 v+ q4 u; l
        read A_leave from "data.txt" with delimiter "\n"
" c& g+ n6 a: J$ q; A; j( @2 n* ]! F        read A_picks from "data.txt" with delimiter "\n"
. L) V) o) M$ S6 V) i5 q3 c        set load type to A_tote
: ]9 `' y1 }! ]; N' t* ^+ ~- r        if A_tote="tote 1" then set A_induct to 1; |8 i/ k2 T. s& `9 w: v9 p4 Y% j
        else if A_tote="tote 2" then set A_induct to 22 V0 w3 C* Y& l+ v
            else set A_induct to 3   
& k# C- @: O1 {( ~        set A_i to 0
# |5 o- e$ n" a8 |: M5 v        clone 1 load to P_induction4 Q& O! h, V/ U$ g
        wait for A_time sec
: G  f/ N: N7 ?! g* [  |3 Y$ w    end
. @0 R0 k1 _. }( G9 Hend
' _( X$ p6 c! a# E. l4 g# V/ x  B# j/ d
begin P_induction arriving9 h0 M2 [4 |' [6 C$ j* k* j# K/ o
    if A_induct=1 then clone 1 load to P_pick1
1 s! A) g6 s. w; `/ Z  ~) V    else if A_induct=2 then clone 1 load to P_pick2
" q8 J, ^( |# }1 P1 R3 a        else clone 1 load to P_pick3
7 H/ \8 P* u/ [3 c% Nend) T) Q; t$ S. |- D( r) i
3 N  P" G5 M! s( v
begin P_pick1 arriving! Z3 ~( A( d9 [( L7 I) Q
    set A_i to 18 [! {$ l/ }5 V0 O
    move into Q_induct1
# M  G' v" g7 o* S    move into pickaisle.induct14 k1 D6 w4 M) e$ z$ n$ [
    while A_i<=30 do begin/ M; P8 C0 f8 t
        travel to pickaisle.con(A_i)
( p4 X4 z/ V0 V3 F7 i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& }9 R* C1 \2 G+ n
        else wait for 10 sec2 B0 F5 ~' o* p, e% Y1 t1 g, i
        if A_i=A_leave then send to die8 {4 B  |. W# @6 W4 y+ B" J
        else inc A_i by 1
2 o" N" _3 R' d2 P, o    end
, U& m' T/ K4 i( |! K4 ~end
% i; y# ]$ w3 e& h7 k
+ E7 j( A8 W) U% nbegin P_pick2 arriving
. T/ S7 d& s- [    set A_i to 11) {/ s* i5 I2 ]0 t
    move into Q_induct2
6 A% {6 @6 V+ Z. `) s    move into pickaisle.induct2' ?# O8 h1 G, h5 S: N: V6 I
    while A_i<=30 do begin
  G2 e- H- K( i/ y        travel to pickaisle.con(A_i)
; K0 W! l9 ?4 N: J9 x( ^! y) x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" @# R7 V/ P/ s- l        else wait for 10 sec% S/ q4 T6 Q+ s! }6 Z8 q
        if A_i=A_leave then send to die# ]+ `+ ^/ Z! j1 }) V" ]5 z
        else inc A_i by 19 c5 ]& B  b  a3 _; e$ C0 f. A
    end
& `0 I: h3 i( y3 _end1 b& F9 A( y+ `
- o& U) P  W( t. d
begin P_pick3 arriving9 K! f1 _: q( J' d! Z5 o
    set A_i to 21; V. }' j3 a: t
    move into Q_induct3/ h$ E; [- U" y( [  d
    move into pickaisle.induct3* J! z2 L8 `, g
    while A_i<=30 do begin9 P0 u+ r# c( v* W
        travel to pickaisle.con(A_i)
' B; _5 G1 L' I3 u# z8 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 s5 E. U: h: t        else wait for 10 sec
, c3 L5 B/ w2 s, d# V/ i# c        if A_i=A_leave then send to die
$ y7 g6 p" k" B! M        else inc A_i by 1) t. `: |: R7 N  U7 p) Y9 u
    end! n0 w. t, \8 `: V
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是个什么东东?
0 v" e8 W, K9 jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ V7 s/ u% e0 d  Q/ D

0 n. i6 a7 L: B5 O6 d- }0 g5 rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! f0 ^' Q! Y; F: t
4 a: g5 q+ D* Y4 [& r  J
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' f$ C& m5 e4 m9 o$ }( l) ~0 b7 @1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, V# Q+ g' T5 B  s7 U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* e$ u$ k8 q  O
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 @3 ^" B2 ?: O8 k+ Gbegin P_induction arriving
' H1 i) ^. m0 {+ N8 _1 Q    clone 1 load to P_pick(A_induct)) Z3 }  X0 Y; Z8 {4 a% e
end最大的系
8 @4 [6 p+ A0 ~7 i3 D# r5 U& T1 F! [
begin P_pick arriving$ c; T4 B9 p- V+ V" z/ Z1 H
    set A_i to procindex * 10 + 1. K. {& K( Z5 e. r7 }' d5 Q2 ^
    move into Q_induct(procindex)
( c: I$ s% j  o0 |* K/ i$ |% s2 M    move into pickaisle.induct(procindex)
* J  R) W5 {  @: Q& s2 E1 e  V    /*check the type of pickaisle.induct(i), for your last problem.*/* a6 g* i' _1 W2 F9 Y
. U% a4 T* X3 P6 n
    while A_i<=30 do begin
8 i1 U2 Z6 t, T/ `' [. B        travel to pickaisle.con(A_i)5 }0 ~9 k6 D3 k3 h' w1 v8 o) e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! i" r# T8 J2 v
        else wait for 10 sec
# k% }" S. F: C8 v/ a2 a( p        if A_i=A_leave then send to die* E( A" {1 h4 I# W5 e" Y) v
        else inc A_i by 1' G& T! X: v4 O
    end1 u5 O& H0 h$ v9 |" ]; |( H% n% ^
end
3 ~0 y$ T2 t* w. g6 N9 S
. ~0 U, }8 h: v- I其中的procindex为整形,代表当前process的序号。
5 E' C3 Z) I: ?) _- v6 Sstation和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-6 03:18 , Processed in 0.019582 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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