设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13891|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, k; \0 A4 H9 m/ V! l8 M' g

7 T; u+ e  t4 [- V1 `; u' w我的问题是,在每个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中的数值,不知道会不会有什么不妥。, ?' V# z+ N5 R
. t0 F4 o9 F! n, i- ]
begin P_read arriving
8 x' G, X) T; c1 ?' [/ `9 @    while 1=1 do begin
# \5 d0 x0 R' T) }5 v' s        read A_tote from "data.txt" with delimiter "\n"- o. }( Y/ f1 Q5 `
        read A_time from "data.txt" with delimiter "\n"
' B' W  L& P# o* h3 G8 d        read A_leave from "data.txt" with delimiter "\n"
; d, V1 H$ Y/ E) z( H5 d        read A_picks from "data.txt" with delimiter "\n"
9 V7 W; l' W9 J8 z# K        set load type to A_tote2 c" Z5 F, M; b
        if A_tote="tote 1" then set A_induct to 17 D9 c6 V+ b/ _+ i6 t
        else if A_tote="tote 2" then set A_induct to 2! |5 o) \) ^3 R5 j8 L# }
            else set A_induct to 3   
6 C7 A3 K6 M, _" d        set A_i to 0  I4 k7 s. U5 U8 {% J
        clone 1 load to P_induction5 j0 n4 A/ P( A9 m" }, |/ W
        wait for A_time sec
$ {2 C  H$ V7 X! ?- a, U, A    end8 i, c3 |9 s% T0 H
end
5 Z% q6 {. u- D! M9 N" n% T/ L, L" f4 Q( P; ]8 b
begin P_induction arriving
5 J- u% t) B0 I. n6 X, W  g$ a3 m    if A_induct=1 then clone 1 load to P_pick1
: X% |+ ~  I4 r+ G: {    else if A_induct=2 then clone 1 load to P_pick2
( e  m6 p# Z6 m- ~+ |: i$ O0 @, H        else clone 1 load to P_pick3: h3 C1 L4 N9 p5 \7 g: y' y
end2 r+ G  z( h7 Y

& ^6 W3 Y+ g- _- n$ m& S+ qbegin P_pick1 arriving
$ Z$ y: y2 e( h& ?# [! `! Z    set A_i to 1& {8 F% n. J3 p
    move into Q_induct10 J$ \' b1 a# S; y7 D( `
    move into pickaisle.induct1! w1 c( o0 ~1 i: S% [9 h
    while A_i<=30 do begin7 U- O$ E' L# f& D8 Q; x; r' W( i2 F
        travel to pickaisle.con(A_i)
& e/ G* F( [! u2 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 p6 m& ?/ _, T2 Q
        else wait for 10 sec/ o/ ?0 e4 |: z
        if A_i=A_leave then send to die/ _& ^) u* J* I; ]# J) r" p2 C
        else inc A_i by 12 A( d7 |* l- X. \' o& r
    end
% P+ `: S) F6 e  E/ Lend
* S8 K$ w5 ]0 _* _% {7 @
1 k# k) b9 G0 O- Sbegin P_pick2 arriving% |1 m  o: Q: G. Z
    set A_i to 110 g4 @  l& `; V6 s% S
    move into Q_induct2
- z: k; O$ j% R  K    move into pickaisle.induct2
  W" [: T* _7 G    while A_i<=30 do begin, x& u& [* K) h% D) L$ I7 X7 V0 y. b
        travel to pickaisle.con(A_i)
1 ~9 u5 v! G8 g& `5 }+ Z- b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 l/ j7 o( A9 k        else wait for 10 sec
5 G2 H* Z/ e1 W1 K" @. L        if A_i=A_leave then send to die& k7 K- q3 W' k7 K
        else inc A_i by 1
9 S# q2 V3 Z: z* r; z0 G    end3 M& U3 r" w+ c( e4 E+ J
end
% R* X: U% k2 L5 y2 f- o: n: [+ z# h9 a! w4 \
begin P_pick3 arriving& x0 P# K% G8 x; }5 r7 L9 l
    set A_i to 21" K1 Z% _( [) V2 s
    move into Q_induct3" r. J+ k" l6 U0 u' o
    move into pickaisle.induct3
3 E- T+ W7 s$ w  `: {9 g' F    while A_i<=30 do begin
& h5 f4 F3 n3 g( B( q( y        travel to pickaisle.con(A_i); ^+ c2 r; g$ I( O+ x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 V; a7 [: D1 E6 L" k3 K" ?
        else wait for 10 sec
: L# ?" t; n1 Y8 O/ b        if A_i=A_leave then send to die1 ^) e8 k* {# c0 b, ]! x6 t" c
        else inc A_i by 1
: p/ K$ n& Y1 g( X& k) n: }1 r: x    end
1 u' i# V8 u$ x* n' B- v( Cend

最佳答案

查看完整内容

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是个什么东东?
$ V2 `5 h! s0 Q. Wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( A; S" [! p' P. m: w; o- p0 Z/ ^& Z* P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% V& z' \+ k0 F1 A# ]+ }" ?( n
! y8 I; i2 U% X6 d4 E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  u. ]7 J8 S6 r0 m5 `1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# o7 j2 f4 j0 p3 J% `7 ?& n8 A0 O2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' N) B& ^' r+ }2 @
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' H* D6 n8 \" G6 L; Pbegin P_induction arriving
% I9 m( ?2 r* f% y0 p1 I    clone 1 load to P_pick(A_induct)9 b; {. Z# [. V/ ?
end最大的系9 y9 d+ L" N- W2 x- V8 l9 s, |" \
# T. g0 Q2 \: ~
begin P_pick arriving# b6 R2 i( ?2 u. ?) V: R
    set A_i to procindex * 10 + 1  V; i7 [! h- ?0 S/ V
    move into Q_induct(procindex)
5 |) f3 r& ~. K' ~% v$ t. T    move into pickaisle.induct(procindex)
6 c3 A# M. q1 S$ G    /*check the type of pickaisle.induct(i), for your last problem.*/
/ u( G, D; S7 `
: L; h0 `% n: W. d. d    while A_i<=30 do begin0 \& p* `5 @1 i) ]1 t
        travel to pickaisle.con(A_i)) z: B8 G+ c0 \- W, F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ R6 m9 {+ X6 J6 r; q
        else wait for 10 sec' C; \( p2 ~7 H8 i, m
        if A_i=A_leave then send to die
+ N( N  l# L/ ]9 a  f        else inc A_i by 1
+ g7 Q8 o  u5 [& a    end
9 e3 \4 W" K2 `* q) O8 H8 eend! |" R: t! K! X# J4 Q
9 H; s$ S4 h- W* r
其中的procindex为整形,代表当前process的序号。
( W6 G0 R, [3 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-5-15 16:34 , Processed in 0.015674 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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