设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12508|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# `) W: S$ i8 ]$ `" J3 z+ ]% e

5 ~  V1 _* N- t& ]8 @我的问题是,在每个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中的数值,不知道会不会有什么不妥。. v3 K6 ]0 ]" m  n2 }1 o  S9 x. n

; ~# M. U, Z; y  U; y6 W, T/ K+ N+ |begin P_read arriving
6 [( c$ y( M$ T% _# _* C    while 1=1 do begin
9 P8 S" R1 O/ l) n% J7 u6 H* G+ `        read A_tote from "data.txt" with delimiter "\n"( _; x; h" R6 X- G1 f
        read A_time from "data.txt" with delimiter "\n": d# \. H+ m8 ~6 B+ p9 Z5 V3 R* Z- V
        read A_leave from "data.txt" with delimiter "\n"! S. c# [) |& [, a% x7 R1 a
        read A_picks from "data.txt" with delimiter "\n"
2 P7 ~- j" t# L4 z# F5 B7 H8 y        set load type to A_tote
+ H! {" g: z/ x" X; `: |        if A_tote="tote 1" then set A_induct to 1
, \. w' p. q& f! h6 t        else if A_tote="tote 2" then set A_induct to 2/ a1 K9 c5 T+ Y! b8 A$ `8 n& X
            else set A_induct to 3    , ~1 h- P* [/ s! V0 i5 F
        set A_i to 0
; G0 {  @# e0 P% w& M. y( t2 m. A0 T. f8 C        clone 1 load to P_induction  K. G7 k7 l( r* t4 ~# ?
        wait for A_time sec! ~* K" `* p$ V/ T
    end- p8 e  F: G& _! |. p. ]. @
end
$ M- a$ r( h1 w# F) S% g0 Y; k6 @6 C# H. l
begin P_induction arriving
9 @" l. `' q1 ^9 c$ \    if A_induct=1 then clone 1 load to P_pick1& {0 q2 f) _, Z) e! v4 C8 [- q
    else if A_induct=2 then clone 1 load to P_pick2
8 Y& b$ Q; w4 P3 `5 P8 z6 T        else clone 1 load to P_pick3
% n8 o8 m& {5 U/ o3 h7 m4 z1 g! N8 Aend
3 J- R0 Z/ @1 J* N4 s
% K( e$ R8 t& ?0 j0 L3 Ibegin P_pick1 arriving
( O6 Y" r) u+ K: S* v    set A_i to 1
# j& n% Y9 ]# M- _) W9 s  ]1 N# x+ J    move into Q_induct1( v, k* z9 \, y
    move into pickaisle.induct13 [: K; O+ u) H. j- O
    while A_i<=30 do begin; m+ Y, z& b. p7 n' T  X
        travel to pickaisle.con(A_i)
; \, d7 H, {3 P8 k# J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) Y# S* I, ]  d2 t        else wait for 10 sec
: {# b& z9 o! B1 d, h, [* H7 M        if A_i=A_leave then send to die2 `6 _: z# I9 [* ~; c
        else inc A_i by 1
; E9 q" q# @6 S: U: R" v. ]1 k    end  _+ \( c6 N% i3 f
end$ Z2 t( Q3 z/ k  J/ T/ S0 V: t5 i7 _

6 A; a! F0 R8 d* W: G+ a( Qbegin P_pick2 arriving! o/ ]# e/ W: T. M( g
    set A_i to 11
2 Q* S# `# V, z0 Y- A1 e    move into Q_induct21 q- g. \  z5 _6 R3 \
    move into pickaisle.induct23 j5 T+ \& g" Y4 ~" q
    while A_i<=30 do begin
6 i4 e$ w5 R$ R2 g) k" |        travel to pickaisle.con(A_i)/ M4 @+ M* y5 q) V2 H, \- f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" S% X% R, C0 M0 f& N" u  a' e
        else wait for 10 sec7 c' u+ s) t% p
        if A_i=A_leave then send to die  o, X* r- M; x/ m1 L& H% E
        else inc A_i by 1
8 O+ {% `' e$ w) T8 s) ~6 v' Q" O, W    end
! O% B, |, C9 Send
9 n- S9 D1 {: W0 C& k. a  E0 L2 l" U3 z1 r
begin P_pick3 arriving: [; n7 x) r8 c- s( {% X
    set A_i to 21& y: O# R! w0 m, G& d
    move into Q_induct3  w! d' u$ d- {; y
    move into pickaisle.induct3! N8 M: A. y  C- V' ^4 ^
    while A_i<=30 do begin! q, o8 l5 n0 z! V* U* l4 Y
        travel to pickaisle.con(A_i)
- I) U" Z& B7 v0 W; G7 E+ q1 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% U8 V1 ?3 x! f5 p/ O4 d        else wait for 10 sec! ]. E) x  s, U& Q% D5 q
        if A_i=A_leave then send to die* l6 z% L7 n! \3 ?9 m6 H
        else inc A_i by 10 s) A/ Y0 |/ {/ A2 @
    end
( g6 {4 }. w5 B. w' x0 Fend

最佳答案

查看完整内容

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是个什么东东?
- n; d4 h$ A2 L+ k! O' E: Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) b1 |1 ?* {' ?7 L1 ]: e! x3 }# e! p, ]1 f
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 D, ]0 C: z! x. T& d$ m. Z. k$ L; C7 G5 R
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* G2 M: _8 l/ I- l& v3 [8 P$ P# _! C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# Z9 s" {( ^9 x! U( u
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 Y1 s# d6 d+ {9 Z$ m  A' d
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! b: a3 P5 X1 o# E- U% p0 ?begin P_induction arriving
) h! r0 F1 `' v8 I( G6 R% z4 W    clone 1 load to P_pick(A_induct), c$ ~6 F4 v* \( u
end最大的系
, A; I- {0 Q5 z6 e' I8 b. v' e. K4 Q# ]' P
begin P_pick arriving: q* L" F5 u$ G2 W
    set A_i to procindex * 10 + 1
- w; c' N7 d6 o! T    move into Q_induct(procindex)
6 Z. E, {  A/ V, M3 g. d7 K    move into pickaisle.induct(procindex)
# J7 q% w( v% \$ x    /*check the type of pickaisle.induct(i), for your last problem.*/: S! s6 M3 F# q: |1 Q' z

4 W) h7 d0 U+ S6 Z    while A_i<=30 do begin3 Y! C; W8 a: L0 Q/ z5 o
        travel to pickaisle.con(A_i)' f( b  o2 \9 B0 z  p* t9 P5 h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" e2 s* f8 `. T9 x        else wait for 10 sec
% O6 Y. [- F! e. F        if A_i=A_leave then send to die
0 D- ?% x! K) p0 M" ~4 m6 J1 @        else inc A_i by 1
" H1 o5 Q) P- g    end
" H( j9 ?7 F; j  R8 B, lend
1 W9 S2 J) D3 @, j3 S! J' f: }: D; x2 f. U' ?. }3 }$ L$ W4 j6 Y. }3 ~* f
其中的procindex为整形,代表当前process的序号。
- h0 q+ o/ e/ `6 estation和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-1-29 06:30 , Processed in 0.017967 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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