设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13949|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 C0 j! l( |* V, L- j: b6 o; B& H/ B
) |( h4 z. n' y3 K3 \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. O$ e* D' U% j* k# t, A9 |( |
$ G+ \+ j6 L. Z, y7 Bbegin P_read arriving$ b0 s5 P  ^6 j4 v+ e. k
    while 1=1 do begin" C* r6 y' e8 N- b
        read A_tote from "data.txt" with delimiter "\n"6 m' \* U1 _9 Z- {3 q% u* y
        read A_time from "data.txt" with delimiter "\n"
; q  C5 _; a9 e6 k- T        read A_leave from "data.txt" with delimiter "\n"
' x+ Y- X# \" z" \; q        read A_picks from "data.txt" with delimiter "\n"
0 c9 ?. t; x2 Y! n( x        set load type to A_tote
$ c0 `* ~, [, Q- {: r: r        if A_tote="tote 1" then set A_induct to 18 b3 n5 t! W5 x* c+ ^4 J0 ^
        else if A_tote="tote 2" then set A_induct to 2' H' G" C: f$ u+ J
            else set A_induct to 3   
" Q& ~7 s- b5 g- b; }: H        set A_i to 0
$ P' w& k1 A; A, I7 F8 T9 {        clone 1 load to P_induction; z2 A1 r7 D+ T2 [
        wait for A_time sec7 d' i& J6 b' Y. O
    end( Q# f- e" S( o$ w# f. Z$ F
end
5 d& ?5 l* P6 j; j, u: l
8 |' Q* r: S% {( Vbegin P_induction arriving3 J3 D: N! I" K4 d' H
    if A_induct=1 then clone 1 load to P_pick1- O3 U3 h1 [' c. A# U1 T4 y
    else if A_induct=2 then clone 1 load to P_pick23 z9 }6 A# M, [
        else clone 1 load to P_pick3* e4 m& j& _/ V$ e
end
7 H6 @4 [$ N; i, L8 m
* S6 W4 e/ K6 o) W8 Y0 |begin P_pick1 arriving
3 H1 @/ R* G/ u9 E, Q/ G+ ~    set A_i to 1
! P" S; g" Y0 Z) g4 k- z. L    move into Q_induct1  e3 r# A! G$ J4 d$ ?. l' y
    move into pickaisle.induct1
( p0 s1 {8 r! A) {. W    while A_i<=30 do begin
" `. q: z" V9 c+ i1 Z( S        travel to pickaisle.con(A_i)* S2 {* g) z2 m) I4 \- _1 c9 \" `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! m3 ?9 j7 d) d; I' F" H
        else wait for 10 sec+ V5 m# ^( K6 @, P9 Z
        if A_i=A_leave then send to die* f3 F0 H3 A' ~6 w: y7 Q
        else inc A_i by 1, S/ K: a$ J" r5 j. Y
    end
! ^' [- n" s, N2 i, i/ f" n, Eend' U$ H1 i& k- E* t8 L

9 f, @! {9 `1 ~; R- bbegin P_pick2 arriving+ N9 C+ j7 {0 k
    set A_i to 11
* u9 K6 G1 ~, D- c8 O6 t    move into Q_induct2
2 c0 s- h- \# F1 v    move into pickaisle.induct2( }1 a  s% D- A5 j" ~: z- B# v
    while A_i<=30 do begin
* I: Y5 c5 m3 ~/ M4 b        travel to pickaisle.con(A_i)
' |( _0 `  Z! X1 R3 m8 w4 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! D7 f0 ^$ Z: Z$ ]6 P2 o0 G, n+ ]        else wait for 10 sec
# h' o. o) E, c1 v" u        if A_i=A_leave then send to die2 P% l2 B, y6 Q! F0 F# R( U; @
        else inc A_i by 1) ]6 y( ^: ^7 `( `3 N0 V. T
    end" z4 y# B  o* }* G: A
end! i9 g- }& j# [: H9 e2 {) c+ X
5 _. y' y) I5 ]- u: o
begin P_pick3 arriving3 n* y) }( \! `' S, k
    set A_i to 216 }6 O) _! D# q# h6 a
    move into Q_induct3- G& K& X) J0 p! Q9 b( T- h
    move into pickaisle.induct3( z( S1 Q& `- n) K6 F! _
    while A_i<=30 do begin
' S# z: p; o! Z" N/ P; F" j9 a% [        travel to pickaisle.con(A_i)7 J' E4 v9 ^5 o" e# ?. M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% Y/ ]8 W& f, L, [% {1 a! g- P9 a
        else wait for 10 sec
) g- W! e; ]+ U$ e/ [        if A_i=A_leave then send to die
% m# F7 k6 i; \  Z& H; W        else inc A_i by 1
( y+ b' T% k$ @( z* S    end( x7 Z1 h) \5 a8 @& N
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是个什么东东?
4 {. U* ]3 h# [/ Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, M4 t7 J: I7 g, b9 O
8 D2 E* B2 d% mAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  Q1 W+ u! s6 G

& ^) b6 J2 ?$ g! [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- s/ ^/ n  r. D3 m  f: Q; D: L1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 c/ X' d' _3 l" d& }+ h( ]& K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 J( i0 W, ]3 R3 I* _. I3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! A; G8 C# {6 Q  ~2 w4 G0 ]
begin P_induction arriving# Y2 c2 X* Z3 _& K) l& |
    clone 1 load to P_pick(A_induct)( [2 Y: B$ E, e; o: e! I8 K
end最大的系
8 M% W  R3 g* p: w& x4 E
  S' _4 q) p7 d2 [  A5 ?begin P_pick arriving
1 ?9 I; U1 [  Z% U    set A_i to procindex * 10 + 1
  `1 P9 T/ i7 n* a% X    move into Q_induct(procindex)
, @, L/ G: q* Y8 L* t3 G; ^" I3 X    move into pickaisle.induct(procindex)8 v" |/ N) n- b6 x
    /*check the type of pickaisle.induct(i), for your last problem.*/
: V8 C5 r# F% y# s: }4 K/ N3 h& a1 Y: n- T( f
    while A_i<=30 do begin
, V3 x: t3 }1 t  ~+ I( ^" Z" u        travel to pickaisle.con(A_i)
# Q9 s6 R! H# l2 i# y  P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- Z& }# z" D& y6 U: e) ^
        else wait for 10 sec
4 ^+ _8 [  ]9 l' N6 m+ `        if A_i=A_leave then send to die: D7 \( W5 m2 @2 N$ w* e  V1 N
        else inc A_i by 1
3 f" V. Z, W, ]5 x8 U8 F- v+ s    end
0 l2 G- a0 ~. hend
* ?9 C& A) U) {) F6 A/ C- Z
. K3 g# s6 _2 a' n9 C其中的procindex为整形,代表当前process的序号。
2 a& i' ?( t- O2 [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-5-23 07:02 , Processed in 0.018857 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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